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, 3 insertions, 2 deletions
diff --git a/src/Network/Torrent/PeerID.hs b/src/Network/Torrent/PeerID.hs
index ec87b470..5ca3ea42 100644
--- a/src/Network/Torrent/PeerID.hs
+++ b/src/Network/Torrent/PeerID.hs
@@ -23,19 +23,20 @@ import qualified Data.ByteString.Lazy as BL
23import qualified Data.ByteString.Builder as B 23import qualified Data.ByteString.Builder as B
24import Data.Foldable (foldMap) 24import Data.Foldable (foldMap)
25import Data.Monoid ((<>)) 25import Data.Monoid ((<>))
26import Data.Serialize (Serialize)
26import Data.Version (Version(Version), versionBranch) 27import Data.Version (Version(Version), versionBranch)
27import Data.Time.Clock (getCurrentTime) 28import Data.Time.Clock (getCurrentTime)
28import Data.Time.Format (formatTime) 29import Data.Time.Format (formatTime)
29import System.Locale (defaultTimeLocale) 30import System.Locale (defaultTimeLocale)
30 31
31-- TODO we have linker error here, so manual hardcoded version for a while. 32-- TODO we have linker error here, so manual hardcoded version for a while.
32--import Paths_network_bittorrent (version) 33-- import Paths_network_bittorrent (version)
33version :: Version 34version :: Version
34version = Version [0, 10, 0, 0] [] 35version = Version [0, 10, 0, 0] []
35 36
36-- | Peer identifier is exactly 20 bytes long bytestring. 37-- | Peer identifier is exactly 20 bytes long bytestring.
37newtype PeerID = PeerID { getPeerID :: ByteString } 38newtype PeerID = PeerID { getPeerID :: ByteString }
38 deriving (Show, Eq, Ord, BEncodable) 39 deriving (Show, Eq, Ord, BEncodable, Serialize)
39 40
40-- | Azureus-style encoding: 41-- | Azureus-style encoding:
41-- * 1 byte : '-' 42-- * 1 byte : '-'