summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2023-08-09 10:20:52 +1000
committerJustin Bedo <cu@cua0.org>2023-08-09 10:20:52 +1000
commita20ffc8d13b568b04ee8bab6a90f241987077ed9 (patch)
treec613c1784fed5d16934812df0a39bc43ee8d882f
parentd7b951b388b36ee5764c24b7afd3fd277ddb1ccf (diff)
hash part of the sequence to add locality
-rw-r--r--dedumi.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/dedumi.hs b/dedumi.hs
index 31fd9fe..c529d1c 100644
--- a/dedumi.hs
+++ b/dedumi.hs
@@ -27,6 +27,9 @@ instance CuckooFilterHash ByteString where
umiLength :: Int
umiLength = 8
+extraHashBases :: Int
+extraHashBases = 4
+
trim :: ReadPair -> ReadPair
trim x =
x
@@ -37,7 +40,7 @@ trim x =
insert' :: (KnownNat b, KnownNat f) => CuckooFilter RealWorld b f ByteString -> ReadPair -> IO Bool
insert' f x =
- let y = B.take umiLength (x ^. _1 . nucs) <> B.take umiLength (x ^. _2 . nucs)
+ let y = B.take (umiLength + extraHashBases) (x ^. _1 . nucs) <> B.take (umiLength + extraHashBases) (x ^. _2 . nucs)
in member f y >>= \case
True -> pure True
False ->