summaryrefslogtreecommitdiff
path: root/src/Network/Address.hs
diff options
context:
space:
mode:
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