Bytes.huff.build: def of gralha-bytes@0.1.0.1 Import: import gralha-bytes@0.1.0.1/bytes.bend as Bytes Lines 183-186 of gralha-bytes@0.1.0.1/bytes.bend: https://jend.leeeet.dev/read.txt?path=gralha-bytes@0.1.0.1/bytes.bend&start_line=183&end_line=186 import Base def huff.build(+lengths: Bytes) -> Huffman: +n = U32.to_nat(bytes.size(lengths)) +counts = huff.counts(n, lengths, 0, Bytes{ByteFlat{0}, 16, 16}) huff.build.loop(n, lengths, 0, huff.codes(15n, counts, 1, 0, bytes.push(bytes.empty(), 0)), HuffEmpty{}) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=ByteTree https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Huffman https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.empty https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.push https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.size https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.build.loop https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.codes https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=huff.counts