Packed.len_hi: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/sha/packed.bend as Packed Lines 5-17 of bend-collections@1.0.0.0/spec/crypto/sha/packed.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/sha/packed.bend&start_line=5&end_line=17 import Base import bend-collections@1.0.0.0/spec/crypto/sha.bend as F # Packed-format reference: logical input byte j is the big-endian byte j%4 # of array word floor(j/4). Only the declared prefix is part of the message. # Block collection uses a generic list reader, not the optimized 16-read chain. def len_hi(+n: Nat) -> U32: +d0 = Nat.div(n, 32n) +d1 = Nat.div(d0, 256n) +d2 = Nat.div(d1, 256n) +d3 = Nat.div(d2, 256n) +d4 = Nat.div(d3, 256n) +d5 = Nat.div(d4, 256n) +d6 = Nat.div(d5, 256n) F.decode(U32.from_nat(Nat.mod(d6, 256n)), U32.from_nat(Nat.mod(d5, 256n)), U32.from_nat(Nat.mod(d4, 256n)), U32.from_nat(Nat.mod(d3, 256n))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/sha.bend&name=decode