def bulk.go

bend-osdev-crc@0.1.0.0 · check.bend:10

import bend-osdev-crc@0.1.0.0/check.bend as Check
import Base

10# n pseudo-random bytes (a linear congruential generator), built tail-recursively
11def bulk.go(n: Nat, +s: U32, acc: List<&2, U32>) -> List<&2, U32>:
12  match n:
13    case 0n:
14      acc
15    case 1n+p:
16      +s2 = U32.add(U32.mul(s, 1103515245), 12345)
17      bulk.go(p, s2, Con{U32.and(U32.shrn(s2, 16n), 255), acc})

Uses (7)

Used by (1)