def w_go
import bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend as Randimport Base
import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as X
181# the 32-bit word of the low 8k bits of n, a byte at a time
182def w_go(k: Nat, +n: Nat) -> U32:
183 match k:
184 case 0n:
185 0
186 case 1n+j:
187 U32.add(U32.from_nat(Nat.mod(n, 256n)), U32.mul(w_go(j, Nat.div(n, 256n)), X.pow2(8n)))