diff options
Diffstat (limited to 'src/Network/Torrent/PeerID.hs')
-rw-r--r-- | src/Network/Torrent/PeerID.hs | 5 |
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 | |||
25 | import Data.Foldable (foldMap) | 25 | import Data.Foldable (foldMap) |
26 | import Data.Monoid ((<>)) | 26 | import Data.Monoid ((<>)) |
27 | import Data.Serialize | 27 | import Data.Serialize |
28 | import Data.URLEncoded | ||
28 | import Data.Version (Version(Version), versionBranch) | 29 | import Data.Version (Version(Version), versionBranch) |
29 | import Data.Time.Clock (getCurrentTime) | 30 | import Data.Time.Clock (getCurrentTime) |
30 | import Data.Time.Format (formatTime) | 31 | import 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 | ||
47 | instance 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 |