def bhash_n_pos
import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstableimport Base
131# Handle bhash n pos in the SSTable indexes, filters, and lookup.
132def bhash_n_pos(+str: String, +seed: U32, +mod: Nat) -> Nat:
133 +w = bhash(str, seed)
134 +a0 = Nat.mod(u32_byte(w, 24n), mod)
135 +a1 = Nat.mod(Nat.add(Nat.mul(a0, 256n), u32_byte(w, 16n)), mod)
136 +a2 = Nat.mod(Nat.add(Nat.mul(a1, 256n), u32_byte(w, 8n)), mod)
137 Nat.mod(Nat.add(Nat.mul(a2, 256n), u32_byte(w, 0n)), mod)