def ch.ok

bend-kit-zlib@0.5.1.0 · zlib.bend:893

import bend-kit-zlib@0.5.1.0/zlib.bend as Zlib
import Base

893# RFC 1951 §3.2.5: a distance is at most 32768.
894def ch.ok(+i: U32, +c: U32, +max: U32, +blen: U32) -> Bool:
895  Bool.and(Bool.and(U32.is_lt(0, c), U32.is_lt((i - c : U32), 32768)), U32.is_lt(blen, max))

Uses (5)

Used by (2)