diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-08 05:45:59 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-08 05:45:59 +0400 |
commit | f1f28f1a128caa3df5cdab2eb4c22ec07633af06 (patch) | |
tree | 5ad34733fa4a5c4579913fa7dbec1928f330302c /src/Network/BitTorrent/Core/PeerId.hs | |
parent | 0a0d09bca9b312de72b4ca57904fae3a7f423e4b (diff) |
Add default instance for PeerInfo
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerId.hs')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerId.hs | 4 |
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 } | |||
73 | peerIdLen :: Int | 73 | peerIdLen :: Int |
74 | peerIdLen = 20 | 74 | peerIdLen = 20 |
75 | 75 | ||
76 | -- | For testing purposes only. | ||
77 | instance Default PeerId where | ||
78 | def = azureusStyle defaultClientId defaultVersionNumber "" | ||
79 | |||
76 | instance Hashable PeerId where | 80 | instance Hashable PeerId where |
77 | hashWithSalt = hashUsing getPeerId | 81 | hashWithSalt = hashUsing getPeerId |
78 | {-# INLINE hashWithSalt #-} | 82 | {-# INLINE hashWithSalt #-} |