summaryrefslogtreecommitdiff
path: root/src/Network/Address.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-09-14 20:29:47 -0400
committerjoe <joe@jerkface.net>2017-09-14 20:29:47 -0400
commitf9ca5de790ea7d430b70471f476ad7b1823b8c0a (patch)
tree49a0b2143755e917a0b801bdeefce88716d0e93c /src/Network/Address.hs
parent7e44a19fae9bc9f90c38641cbc5cf8af9c540ecb (diff)
Switched to the 3-transports (DHT,Onion,Crypto) Tox design.
Diffstat (limited to 'src/Network/Address.hs')
-rw-r--r--src/Network/Address.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/Address.hs b/src/Network/Address.hs
index cc06ac0d..9a601dcd 100644
--- a/src/Network/Address.hs
+++ b/src/Network/Address.hs
@@ -648,6 +648,10 @@ genBucketSample' gen self (q,m,b)
648 | otherwise = either error id . S.decode . build <$> gen (nodeIdSize - q + 1) 648 | otherwise = either error id . S.decode . build <$> gen (nodeIdSize - q + 1)
649 where 649 where
650 nodeIdSize = finiteBitSize (undefined :: nid) `div` 8 650 nodeIdSize = finiteBitSize (undefined :: nid) `div` 8
651
652 -- Prepends q bytes to modified input:
653 -- applies mask m
654 -- toggles bit b
651 build tl = BS.init hd <> BS.cons (h .|. t) (BS.tail tl) 655 build tl = BS.init hd <> BS.cons (h .|. t) (BS.tail tl)
652 where 656 where
653 hd = BS.take q $ S.encode self 657 hd = BS.take q $ S.encode self