Modes.CrModes.blocks_of: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/modes.bend as Modes Lines 159-163 of bend-osdev-crypto@0.1.0.0/modes.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&start_line=159&end_line=163 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr # A byte string of whole blocks as its blocks (CrNotBlockMultiple otherwise) def CrModes.blocks_of(~Blk: Data, ~bsize: Nat, ~blk_of: B.Octets -> Maybe<&2, Blk>, o: B.Octets) -> Result<&2, &2, Cr.CrError, List<&2, Blk>>: +xs = B.Octets.to_list(o) +len = B.len.fast(xs) cr.blocks_of.ok(~Blk, cr.divides(Nat.is_lt(0n, bsize), len, bsize), cr.blocks_of.go(~Blk, ~blk_of, cr.chunks(xs, bsize, 0n, Nil{}, Nil{}), Some{Nil{}}), len) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.to_list https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=len.fast https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/crypto.bend&name=CrError https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.blocks_of.go https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.blocks_of.ok https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.chunks https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.divides