def slice
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
341# The buffer back, and a copy of up to n bytes from start. Both ends are clamped to len.
342def slice(b: Bytes, +start: U32, +n: U32) -> Bytes & Bytes:
343 Bytes{+len, buf} = b
344 +s = U32.min(start, len)
345 slice.at(len, buf, s, U32.min(n, (len - s : U32)))