diff options
Diffstat (limited to 'src/Network/Torrent/PeerID.hs')
-rw-r--r-- | src/Network/Torrent/PeerID.hs | 5 |
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 | |||
23 | import qualified Data.ByteString.Builder as B | 23 | import qualified Data.ByteString.Builder as B |
24 | import Data.Foldable (foldMap) | 24 | import Data.Foldable (foldMap) |
25 | import Data.Monoid ((<>)) | 25 | import Data.Monoid ((<>)) |
26 | import Data.Serialize (Serialize) | ||
26 | import Data.Version (Version(Version), versionBranch) | 27 | import Data.Version (Version(Version), versionBranch) |
27 | import Data.Time.Clock (getCurrentTime) | 28 | import Data.Time.Clock (getCurrentTime) |
28 | import Data.Time.Format (formatTime) | 29 | import Data.Time.Format (formatTime) |
29 | import System.Locale (defaultTimeLocale) | 30 | import 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) |
33 | version :: Version | 34 | version :: Version |
34 | version = Version [0, 10, 0, 0] [] | 35 | version = 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. |
37 | newtype PeerID = PeerID { getPeerID :: ByteString } | 38 | newtype 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 : '-' |