Sstable.bhash_n_pos: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable Lines 131-137 of mylsm-lsm-store@0.6.0.1/src/Sstable.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/Sstable.bend&start_line=131&end_line=137 import Base # Handle bhash n pos in the SSTable indexes, filters, and lookup. def bhash_n_pos(+str: String, +seed: U32, +mod: Nat) -> Nat: +w = bhash(str, seed) +a0 = Nat.mod(u32_byte(w, 24n), mod) +a1 = Nat.mod(Nat.add(Nat.mul(a0, 256n), u32_byte(w, 16n)), mod) +a2 = Nat.mod(Nat.add(Nat.mul(a1, 256n), u32_byte(w, 8n)), mod) Nat.mod(Nat.add(Nat.mul(a2, 256n), u32_byte(w, 0n)), mod) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Sstable.bend&name=bhash https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Sstable.bend&name=u32_byte