def diff

bend-collections-laws-crypto@1.0.0.0 · src/crypto/subtle.bend:16

import bend-collections-laws-crypto@1.0.0.0/src/crypto/subtle.bend as Subtle
import Base

16# OR of the XOR of every pair of positions, over the common prefix.
17def diff(a: List<&2, U32>, b: List<&2, U32>, acc: U32) -> U32:
18  match a b:
19    case x <> xs y <> ys:
20      diff(xs, ys, U32.or(acc, U32.xor(x, y)))
21    case _ _:
22      acc

Uses (4)

Used by (6)