diff options
-rw-r--r-- | bittorrent.cabal | 2 | ||||
-rw-r--r-- | src/Data/Torrent.hs | 4 | ||||
-rw-r--r-- | src/Data/Torrent/InfoHash.hs | 4 | ||||
-rw-r--r-- | src/Network/BitTorrent/Core/PeerId.hs | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal index 7f5a42ae..762bff01 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal | |||
@@ -113,7 +113,7 @@ library | |||
113 | 113 | ||
114 | -- Hashing | 114 | -- Hashing |
115 | , cryptohash == 0.10.* | 115 | , cryptohash == 0.10.* |
116 | , hashable | 116 | , hashable >= 1.2 |
117 | 117 | ||
118 | -- Codecs & Serialization | 118 | -- Codecs & Serialization |
119 | , aeson >= 0.6.2.0 | 119 | , aeson >= 0.6.2.0 |
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index 7469d621..ce919907 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -137,8 +137,8 @@ instance NFData InfoDict where | |||
137 | rnf InfoDict {..} = rnf idLayoutInfo | 137 | rnf InfoDict {..} = rnf idLayoutInfo |
138 | 138 | ||
139 | instance Hashable InfoDict where | 139 | instance Hashable InfoDict where |
140 | hash = Hashable.hash . idInfoHash | 140 | hashWithSalt = Hashable.hashUsing idInfoHash |
141 | {-# INLINE hash #-} | 141 | {-# INLINE hashWithSalt #-} |
142 | 142 | ||
143 | -- | Smart constructor: add a info hash to info dictionary. | 143 | -- | Smart constructor: add a info hash to info dictionary. |
144 | infoDictionary :: LayoutInfo -> PieceInfo -> Bool -> InfoDict | 144 | infoDictionary :: LayoutInfo -> PieceInfo -> Bool -> InfoDict |
diff --git a/src/Data/Torrent/InfoHash.hs b/src/Data/Torrent/InfoHash.hs index d840ac87..4d49fcb7 100644 --- a/src/Data/Torrent/InfoHash.hs +++ b/src/Data/Torrent/InfoHash.hs | |||
@@ -70,8 +70,8 @@ instance Default InfoHash where | |||
70 | 70 | ||
71 | -- | Hash raw bytes. (no encoding) | 71 | -- | Hash raw bytes. (no encoding) |
72 | instance Hashable InfoHash where | 72 | instance Hashable InfoHash where |
73 | hash (InfoHash ih) = Hashable.hash ih | 73 | hashWithSalt s (InfoHash ih) = hashWithSalt s ih |
74 | {-# INLINE hash #-} | 74 | {-# INLINE hashWithSalt #-} |
75 | 75 | ||
76 | -- | Convert to\/from raw bencoded string. (no encoding) | 76 | -- | Convert to\/from raw bencoded string. (no encoding) |
77 | instance BEncode InfoHash where | 77 | instance BEncode InfoHash where |
diff --git a/src/Network/BitTorrent/Core/PeerId.hs b/src/Network/BitTorrent/Core/PeerId.hs index 148f550d..1b4409a8 100644 --- a/src/Network/BitTorrent/Core/PeerId.hs +++ b/src/Network/BitTorrent/Core/PeerId.hs | |||
@@ -74,8 +74,8 @@ peerIdLen :: Int | |||
74 | peerIdLen = 20 | 74 | peerIdLen = 20 |
75 | 75 | ||
76 | instance Hashable PeerId where | 76 | instance Hashable PeerId where |
77 | hash = hash . getPeerId | 77 | hashWithSalt = hashUsing getPeerId |
78 | {-# INLINE hash #-} | 78 | {-# INLINE hashWithSalt #-} |
79 | 79 | ||
80 | instance Serialize PeerId where | 80 | instance Serialize PeerId where |
81 | put = putByteString . getPeerId | 81 | put = putByteString . getPeerId |