MCPcopy
hub / github.com/gildas-lormeau/zip.js / readCommonHeader

Function readCommonHeader

index.cjs:3957–3974  ·  view source on GitHub ↗
(directory, dataView, offset)

Source from the content-addressed store, hash-verified

3955};
3956
3957function readCommonHeader(directory, dataView, offset) {
3958 const rawBitFlag = directory.rawBitFlag = getUint16(dataView, offset + 2);
3959 const encrypted = (rawBitFlag & BITFLAG_ENCRYPTED) == BITFLAG_ENCRYPTED;
3960 const rawLastModDate = getUint32(dataView, offset + 6);
3961 Object.assign(directory, {
3962 encrypted,
3963 version: getUint16(dataView, offset),
3964 bitFlag: {
3965 level: (rawBitFlag & BITFLAG_LEVEL) >> 1,
3966 dataDescriptor: (rawBitFlag & BITFLAG_DATA_DESCRIPTOR) == BITFLAG_DATA_DESCRIPTOR,
3967 languageEncodingFlag: (rawBitFlag & BITFLAG_LANG_ENCODING_FLAG) == BITFLAG_LANG_ENCODING_FLAG
3968 },
3969 rawLastModDate,
3970 lastModDate: getDate(rawLastModDate),
3971 filenameLength: getUint16(dataView, offset + 22),
3972 extraFieldLength: getUint16(dataView, offset + 24)
3973 });
3974}
3975
3976function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory) {
3977 const { rawExtraField } = directory;

Callers 2

getEntriesGeneratorMethod · 0.70
getDataMethod · 0.70

Calls 3

getUint16Function · 0.70
getUint32Function · 0.70
getDateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…