MCPcopy Create free account
hub / github.com/Effect-TS/effect / dataDescriptor

Function dataDescriptor

packages/effect/src/encoding/Zip.ts:987–1001  ·  view source on GitHub ↗
(record: EntryRecord)

Source from the content-addressed store, hash-verified

985}
986
987const dataDescriptor = (record: EntryRecord): Uint8Array => {
988 const wide = record.zip64
989 const bytes = new Uint8Array(wide ? 24 : 16)
990 const view = new DataView(bytes.buffer)
991 view.setUint32(0, DESCRIPTOR, true)
992 view.setUint32(4, record.crc, true)
993 if (wide) {
994 setUint64(view, 8, record.compressedSize)
995 setUint64(view, 16, record.size)
996 } else {
997 view.setUint32(8, record.compressedSize, true)
998 view.setUint32(12, record.size, true)
999 }
1000 return bytes
1001}
1002
1003const centralHeader = (record: EntryRecord): Uint8Array => {
1004 // ZIP64 holds only the fields that overflow, in this order

Callers 1

endMethod · 0.85

Calls 1

setUint64Function · 0.85

Tested by

no test coverage detected