def uint64n
import bend-collections-laws-crypto@1.0.0.0/src/math/random/rand.bend as Randimport Base
import bend-collections-laws-crypto@1.0.0.0/src/math/u64.bend as W
166# uniform in [0, n) for n > 0 (Go's Uint64N)
167def uint64n(~S: Data, ~next: S -> W.U64 & S, s: S, +n: W.U64) -> W.U64 & S:
168 uint64n_pick(~S, ~next, s, n, is_pow2(n))
Uses (4)
Used by (10)
- bend-collections-laws-crypto@1.0.0.0/src/math/random/rand:shuffle_step
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/bounded:uint64n_lt
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/shuffle:go_occ
- bend-collections-laws-crypto@1.0.0.0/proofs/math/random/uint64n:value_vn
- bend-collections-laws-crypto@1.0.0.0/spec/math/random:Uint64n.lt
- …