def done

bend-kit-encoding@0.5.0.0 · encoding.bend:19

import bend-kit-encoding@0.5.0.0/encoding.bend as Encoding
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

19def done(o: Out) -> Bytes.Bytes:
20  Out{buf, +n, +w} = o
21  +r = (n .&. 3 : U32)
22  Bytes.Bytes{n, Bytes.flush(U32.is_ne(r, 0), buf, (n >> 2n : U32), U32.shrn(w, U32.to_nat((((4 - r) .&. 3) * 8 : U32))))}

Uses (10)

Used by (1)