def checksum.adler.loop

gralha-bytes@0.1.0.1 · bytes.bend:366

import gralha-bytes@0.1.0.1/bytes.bend as Bytes
import Base

366def checksum.adler.loop(n: Nat, +src: Bytes, +index: U32, +a: U32, b: U32) -> U32:
367  match n:
368    case 0n: (b * 65536 + a : U32)
369    case 1n+d:
370      +aa = ((a + bytes.get(src, index)) % 65521 : U32)
371      checksum.adler.loop(d, src, U32.inc(index), aa, ((b + aa) % 65521 : U32))

Uses (8)

Used by (1)