def unique.print

bend-kit-json@0.7.0.0 · json.bend:759

import bend-kit-json@0.7.0.0/json.bend as Json
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

759# The key back, and its fingerprint: the length, then its words. Bytes past the
760# length are 0, so two keys are equal exactly when their fingerprints are.
761def unique.print(k: Bytes.Bytes) -> Bytes.Bytes & List<&2, U32>:
762  Bytes.Bytes{+len, buf} = k
763  +n = Bytes.words(len)
764  +i = (n - 1 : U32)
765  unique.print.fin(len, unique.print.go(U32.to_nat(n), Array.get(U32, buf, i), i, Nil{}))

Uses (10)

Used by (1)