def length_octets
import mylsm-lsm-store@0.6.0.1/src/hub_sha/core.bend as Coreimport Base
247# Return the length of gth octets in the SHA-256 compression implementation.
248def length_octets(count: Nat, +byte_length: Nat, acc: List<&2, U32>) -> List<&2, U32>:
249 match count:
250 case 0n:
251 acc
252 case 1n+p:
253 length_octets(p, Nat.div(byte_length, 256n), U32.from_nat(Nat.mod(byte_length, 256n)) <> acc)