Archive.cd.err: def of bend-kit-archive@0.5.1.0 Import: import bend-kit-archive@0.5.1.0/archive.bend as Archive Lines 168-181 of bend-kit-archive@0.5.1.0/archive.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-archive@0.5.1.0/archive.bend&start_line=168&end_line=181 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes # Central directory file header (APPNOTE 4.3.12) at p, with the directory ending at end. def cd.err(+h: List<&2, U32>, +p: U32, +end: U32) -> Maybe<&2, String>: +method = u16(h, 10) +packed = u32(h, 20) +size = u32(h, 24) +rest = (u16(h, 28) + u16(h, 30) + u16(h, 32) : U32) +zip64 = Bool.or(Bool.or(U32.is_eq(packed, 4294967295), U32.is_eq(size, 4294967295)), U32.is_eq(u32(h, 42), 4294967295)) why(U32.is_eq(u32(h, 0), 33639248), "bad central directory header signature", why(Bool.not(encrypted(u16(h, 8))), "encrypted entries are unsupported", why(supported(method), "unsupported compression method " ++ U32.show(method), why(Bool.not(zip64), "ZIP64 is unsupported", why(U32.is_eq(u16(h, 34), 0), "multi-disk ZIP is unsupported", why(Bytes.fits(end, (p + 46 : U32), rest), "central directory header runs past the directory", why(Bool.or(U32.is_eq(method, 8), U32.is_eq(packed, size)), "stored entry sizes differ", None{}))))))) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or 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=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.show https://jend.leeeet.dev/definition.txt?path=bend-kit-archive@0.5.1.0/archive.bend&name=encrypted https://jend.leeeet.dev/definition.txt?path=bend-kit-archive@0.5.1.0/archive.bend&name=supported https://jend.leeeet.dev/definition.txt?path=bend-kit-archive@0.5.1.0/archive.bend&name=u16 https://jend.leeeet.dev/definition.txt?path=bend-kit-archive@0.5.1.0/archive.bend&name=u32 https://jend.leeeet.dev/definition.txt?path=bend-kit-archive@0.5.1.0/archive.bend&name=why https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=fits