summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/DHT/Token.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/DHT/Token.hs b/src/Network/BitTorrent/DHT/Token.hs
index 7aaaf2b7..3f71aabe 100644
--- a/src/Network/BitTorrent/DHT/Token.hs
+++ b/src/Network/BitTorrent/DHT/Token.hs
@@ -40,8 +40,10 @@ module Network.BitTorrent.DHT.Token
40import Control.Monad.State 40import Control.Monad.State
41import Data.BEncode (BEncode) 41import Data.BEncode (BEncode)
42import Data.ByteString as BS 42import Data.ByteString as BS
43import Data.ByteString.Char8 as B8
43import Data.ByteString.Lazy as BL 44import Data.ByteString.Lazy as BL
44import Data.ByteString.Lazy.Builder as BS 45import Data.ByteString.Lazy.Builder as BS
46import qualified Data.ByteString.Base16 as Base16
45import Data.Default 47import Data.Default
46import Data.List as L 48import Data.List as L
47import Data.Hashable 49import Data.Hashable
@@ -55,7 +57,10 @@ import Network.BitTorrent.Address
55 57
56-- | An opaque value. 58-- | An opaque value.
57newtype Token = Token BS.ByteString 59newtype Token = Token BS.ByteString
58 deriving (Show, Eq, BEncode, IsString) 60 deriving (Eq, BEncode, IsString)
61
62instance Show Token where
63 show (Token bs) = B8.unpack $ Base16.encode bs
59 64
60-- | Meaningless token, for testing purposes only. 65-- | Meaningless token, for testing purposes only.
61instance Default Token where 66instance Default Token where