From f198e2b07a53603fa854b3a74702948493525613 Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 31 Aug 2017 23:45:35 -0400 Subject: Miscelaneous exports and TODO: Bits NodeId --- ToxAddress.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ToxAddress.hs') diff --git a/ToxAddress.hs b/ToxAddress.hs index 9aa7a575..f0d4aba3 100644 --- a/ToxAddress.hs +++ b/ToxAddress.hs @@ -41,6 +41,7 @@ import Network.Address hiding (nodePort) import System.IO.Unsafe (unsafeDupablePerformIO) import qualified Text.ParserCombinators.ReadP as RP import Text.Read +import Data.Bits -- | perform io for hashes that do allocation and ffi. -- unsafeDupablePerformIO is used when possible as the @@ -85,6 +86,11 @@ instance S.Serialize NodeId where get = NodeId . throwCryptoError . publicKey <$> S.getBytes 32 put (NodeId bs) = S.putByteString $ BA.convert bs +instance Bits NodeId where -- TODO + +instance FiniteBits NodeId where + finiteBitSize _ = 256 + data NodeInfo = NodeInfo { nodeId :: NodeId , nodeIP :: IP -- cgit v1.2.3