diff options
Diffstat (limited to 'src/Network/BitTorrent/DHT')
-rw-r--r-- | src/Network/BitTorrent/DHT/Token.hs | 7 |
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 | |||
40 | import Control.Monad.State | 40 | import Control.Monad.State |
41 | import Data.BEncode (BEncode) | 41 | import Data.BEncode (BEncode) |
42 | import Data.ByteString as BS | 42 | import Data.ByteString as BS |
43 | import Data.ByteString.Char8 as B8 | ||
43 | import Data.ByteString.Lazy as BL | 44 | import Data.ByteString.Lazy as BL |
44 | import Data.ByteString.Lazy.Builder as BS | 45 | import Data.ByteString.Lazy.Builder as BS |
46 | import qualified Data.ByteString.Base16 as Base16 | ||
45 | import Data.Default | 47 | import Data.Default |
46 | import Data.List as L | 48 | import Data.List as L |
47 | import Data.Hashable | 49 | import Data.Hashable |
@@ -55,7 +57,10 @@ import Network.BitTorrent.Address | |||
55 | 57 | ||
56 | -- | An opaque value. | 58 | -- | An opaque value. |
57 | newtype Token = Token BS.ByteString | 59 | newtype Token = Token BS.ByteString |
58 | deriving (Show, Eq, BEncode, IsString) | 60 | deriving (Eq, BEncode, IsString) |
61 | |||
62 | instance 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. |
61 | instance Default Token where | 66 | instance Default Token where |