Sstable.u32_to_nat_exact: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable Lines 123-129 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=123&end_line=129 import Base # Encode or decode a 32-bit word for to nat exact for the SSTable indexes, filters, and lookup. def u32_to_nat_exact(+word: U32) -> Nat: +b0 = u32_byte(word, 24n) +b1 = u32_byte(word, 16n) +b2 = u32_byte(word, 8n) +b3 = u32_byte(word, 0n) Nat.add(Nat.mul(b0, Nat.mul(Nat.mul(256n, 256n), 256n)), Nat.add(Nat.mul(b1, Nat.mul(256n, 256n)), Nat.add(Nat.mul(b2, 256n), b3))) Uses (5): 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.mul 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=u32_byte