diff options
author | Justin Bedo <cu@cua0.org> | 2023-08-09 10:20:52 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2023-08-09 10:20:52 +1000 |
commit | a20ffc8d13b568b04ee8bab6a90f241987077ed9 (patch) | |
tree | c613c1784fed5d16934812df0a39bc43ee8d882f | |
parent | d7b951b388b36ee5764c24b7afd3fd277ddb1ccf (diff) |
hash part of the sequence to add locality
-rw-r--r-- | dedumi.hs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 -> |