From 1e22d4d33ad6b7da93f7fd1fd757f10d74d98309 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Fri, 27 Dec 2013 12:58:17 +0400 Subject: Add naive session tokens implementation --- src/Network/BitTorrent/Core/PeerAddr.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs') diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs index 261df8d0..9f5c7c5d 100644 --- a/src/Network/BitTorrent/Core/PeerAddr.hs +++ b/src/Network/BitTorrent/Core/PeerAddr.hs @@ -38,6 +38,7 @@ import Data.BEncode.BDict (BKey) import Data.ByteString.Char8 as BS8 import Data.Char import Data.Default +import Data.Hashable import Data.HashMap.Strict as HM import Data.IP import Data.List as L @@ -81,6 +82,10 @@ instance Serialize PortNumber where put = putWord16be . fromIntegral {-# INLINE put #-} +instance Hashable PortNumber where + hashWithSalt s = hashWithSalt s . fromEnum + {-# INLINE hashWithSalt #-} + {----------------------------------------------------------------------- -- IP addr -----------------------------------------------------------------------} -- cgit v1.2.3