summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Core
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-08 05:45:59 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-08 05:45:59 +0400
commitf1f28f1a128caa3df5cdab2eb4c22ec07633af06 (patch)
tree5ad34733fa4a5c4579913fa7dbec1928f330302c /src/Network/BitTorrent/Core
parent0a0d09bca9b312de72b4ca57904fae3a7f423e4b (diff)
Add default instance for PeerInfo
Diffstat (limited to 'src/Network/BitTorrent/Core')
-rw-r--r--src/Network/BitTorrent/Core/PeerId.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Core/PeerId.hs b/src/Network/BitTorrent/Core/PeerId.hs
index cab30331..c860d9d4 100644
--- a/src/Network/BitTorrent/Core/PeerId.hs
+++ b/src/Network/BitTorrent/Core/PeerId.hs
@@ -73,6 +73,10 @@ newtype PeerId = PeerId { getPeerId :: ByteString }
73peerIdLen :: Int 73peerIdLen :: Int
74peerIdLen = 20 74peerIdLen = 20
75 75
76-- | For testing purposes only.
77instance Default PeerId where
78 def = azureusStyle defaultClientId defaultVersionNumber ""
79
76instance Hashable PeerId where 80instance Hashable PeerId where
77 hashWithSalt = hashUsing getPeerId 81 hashWithSalt = hashUsing getPeerId
78 {-# INLINE hashWithSalt #-} 82 {-# INLINE hashWithSalt #-}