def depth_go

bend-collections-laws-crypto@1.0.0.0 · src/crypto/blake/blake2b/sized.bend:43

import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake2b/sized.bend as Sized
import Base

43# The smallest d >= k with 2^d >= n.
44def depth_go(fuel: Nat, +n: Nat, +d: Nat, done: Bool) -> Nat:
45  match fuel done:
46    case _ True{}:
47      d
48    case 0n False{}:
49      d
50    case 1n+f False{}:
51      depth_go(f, n, 1n+d, Nat.is_le(n, pw(1n+d)))

Uses (4)

Used by (4)