summaryrefslogtreecommitdiff
path: root/src/Network/Torrent/PeerID.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Torrent/PeerID.hs')
-rw-r--r--src/Network/Torrent/PeerID.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Network/Torrent/PeerID.hs b/src/Network/Torrent/PeerID.hs
index 0eb4cbbb..f0ce790c 100644
--- a/src/Network/Torrent/PeerID.hs
+++ b/src/Network/Torrent/PeerID.hs
@@ -25,6 +25,7 @@ import qualified Data.ByteString.Builder as B
25import Data.Foldable (foldMap) 25import Data.Foldable (foldMap)
26import Data.Monoid ((<>)) 26import Data.Monoid ((<>))
27import Data.Serialize 27import Data.Serialize
28import Data.URLEncoded
28import Data.Version (Version(Version), versionBranch) 29import Data.Version (Version(Version), versionBranch)
29import Data.Time.Clock (getCurrentTime) 30import Data.Time.Clock (getCurrentTime)
30import Data.Time.Format (formatTime) 31import Data.Time.Format (formatTime)
@@ -43,6 +44,10 @@ instance Serialize PeerID where
43 put = putByteString . getPeerID 44 put = putByteString . getPeerID
44 get = PeerID <$> getBytes 20 45 get = PeerID <$> getBytes 20
45 46
47instance URLShow PeerID where
48 urlShow = BC.unpack . getPeerID
49
50
46-- | Azureus-style encoding: 51-- | Azureus-style encoding:
47-- * 1 byte : '-' 52-- * 1 byte : '-'
48-- * 2 bytes: client id 53-- * 2 bytes: client id