code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
constructor(options, { chunkSize, DecompressionStream, DecompressionStreamNative }) {
super({});
const { zipCrypto, encrypted, signed, signature, compressed, useCompressionStream } = options;
let crc32Stream, decryptionStream;
let readable = filterEmptyChunks(super.readable);
if (encrypted) {
if (zip... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function filterEmptyChunks(readable) {
return pipeThrough(readable, new TransformStream({
transform(chunk, controller) {
if (chunk && chunk.length) {
controller.enqueue(chunk);
}
}
}));
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | filterEmptyChunks | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
transform(chunk, controller) {
if (chunk && chunk.length) {
controller.enqueue(chunk);
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | transform | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function setReadable(stream, readable, flush) {
readable = pipeThrough(readable, new TransformStream({ flush }));
Object.defineProperty(stream, "readable", {
get() {
return readable;
}
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | setReadable | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get() {
return readable;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | get | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function pipeThroughCommpressionStream(readable, useCompressionStream, options, CodecStreamNative, CodecStream) {
try {
const CompressionStream = useCompressionStream && CodecStreamNative ? CodecStreamNative : CodecStream;
readable = pipeThrough(readable, new CompressionStream(COMPRESSION_FORMAT, options));
... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | pipeThroughCommpressionStream | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function pipeThrough(readable, transformStream) {
return readable.pipeThrough(transformStream);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | pipeThrough | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(options, config) {
super({});
const codec = this;
const { codecType } = options;
let Stream;
if (codecType.startsWith(CODEC_DEFLATE)) {
Stream = DeflateStream;
} else if (codecType.startsWith(CODEC_INFLATE)) {
Stream = InflateStream;
}
let outputSize = 0;
let inputSize = 0... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
transform(chunk, controller) {
if (chunk && chunk.length) {
inputSize += chunk.length;
controller.enqueue(chunk);
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | transform | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
flush() {
Object.assign(codec, {
inputSize
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | flush | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
transform(chunk, controller) {
if (chunk && chunk.length) {
outputSize += chunk.length;
controller.enqueue(chunk);
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | transform | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
flush() {
const { signature } = stream;
Object.assign(codec, {
signature,
outputSize,
inputSize
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | flush | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get() {
return readable.pipeThrough(inputSizeStream).pipeThrough(stream).pipeThrough(outputSizeStream);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | get | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(chunkSize) {
let pendingChunk;
super({
transform,
flush(controller) {
if (pendingChunk && pendingChunk.length) {
controller.enqueue(pendingChunk);
}
}
});
function transform(chunk, controller) {
if (pendingChunk) {
const newChunk = new Uint8Array(pendingChun... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
flush(controller) {
if (pendingChunk && pendingChunk.length) {
controller.enqueue(pendingChunk);
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | flush | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function transform(chunk, controller) {
if (pendingChunk) {
const newChunk = new Uint8Array(pendingChunk.length + chunk.length);
newChunk.set(pendingChunk);
newChunk.set(chunk, pendingChunk.length);
chunk = newChunk;
pendingChunk = null;
}
if (chunk.length > chunkSize) {
contro... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | transform | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(workerData, { readable, writable }, { options, config, streamOptions, useWebWorkers, transferStreams, scripts }, onTaskFinished) {
const { signal } = streamOptions;
Object.assign(workerData, {
busy: true,
readable: readable
.pipeThrough(new ChunkStream(config.chunkSize))
.pipeThrough... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
terminate() {
return new Promise(resolve => {
const { worker, busy } = workerData;
if (worker) {
if (busy) {
workerData.resolveTerminated = resolve;
} else {
worker.terminate();
resolve();
}
workerData.interface = null;
} else {
resolve()... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | terminate | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
onTaskFinished() {
const { resolveTerminated } = workerData;
if (resolveTerminated) {
workerData.resolveTerminated = null;
workerData.terminated = true;
workerData.worker.terminate();
resolveTerminated();
}
workerData.busy = false;
onTaskFinished(workerData);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | onTaskFinished | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(readableSource, { onstart, onprogress, size, onend }) {
let chunkOffset = 0;
super({
async start() {
if (onstart) {
await callHandler(onstart, size);
}
},
async transform(chunk, controller) {
chunkOffset += chunk.length;
if (onprogress) {
await callHandler(o... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async start() {
if (onstart) {
await callHandler(onstart, size);
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | start | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async transform(chunk, controller) {
chunkOffset += chunk.length;
if (onprogress) {
await callHandler(onprogress, chunkOffset, size);
}
controller.enqueue(chunk);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | transform | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async flush() {
readableSource.size = chunkOffset;
if (onend) {
await callHandler(onend, chunkOffset);
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | flush | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function callHandler(handler, ...parameters) {
try {
await handler(...parameters);
// eslint-disable-next-line no-unused-vars
} catch (_) {
// ignored
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | callHandler | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function createWorkerInterface(workerData, config) {
return {
run: () => runWorker$1(workerData, config)
};
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createWorkerInterface | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function createWebWorkerInterface(workerData, config) {
const { baseURL, chunkSize } = config;
if (!workerData.interface) {
let worker;
try {
worker = getWebWorker(workerData.scripts[0], baseURL, workerData);
// eslint-disable-next-line no-unused-vars
} catch (_) {
WEB_WORKERS_SUPPORTED = false... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createWebWorkerInterface | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function runWorker$1({ options, readable, writable, onTaskFinished }, config) {
try {
const codecStream = new CodecStream(options, config);
await readable.pipeThrough(codecStream).pipeTo(writable, { preventClose: true, preventAbort: true });
const {
signature,
inputSize,
outputSize
} = c... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | runWorker$1 | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function runWebWorker(workerData, config) {
let resolveResult, rejectResult;
const result = new Promise((resolve, reject) => {
resolveResult = resolve;
rejectResult = reject;
});
Object.assign(workerData, {
reader: null,
writer: null,
resolveResult,
rejectResult,
result
});
const ... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | runWebWorker | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function watchClosedStream(writableSource) {
let resolveStreamClosed;
const closed = new Promise(resolve => resolveStreamClosed = resolve);
const writable = new WritableStream({
async write(chunk) {
const writer = writableSource.getWriter();
await writer.ready;
await writer.write(chunk);
writer... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | watchClosedStream | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async write(chunk) {
const writer = writableSource.getWriter();
await writer.ready;
await writer.write(chunk);
writer.releaseLock();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | write | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
abort(reason) {
const writer = writableSource.getWriter();
return writer.abort(reason);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | abort | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function getWebWorker(url, baseURL, workerData) {
const workerOptions = { type: "module" };
let scriptUrl, worker;
if (typeof url == FUNCTION_TYPE) {
url = url();
}
try {
scriptUrl = new URL(url, baseURL);
// eslint-disable-next-line no-unused-vars
} catch (_) {
scriptUrl = url;
}
if (classi... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getWebWorker | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function sendMessage(message, { worker, writer, onTaskFinished, transferStreams }) {
try {
const { value, readable, writable } = message;
const transferables = [];
if (value) {
if (value.byteLength < value.buffer.byteLength) {
message.value = value.buffer.slice(0, value.byteLength);
}
else {... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | sendMessage | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function onMessage({ data }, workerData) {
const { type, value, messageId, result, error } = data;
const { reader, writer, resolveResult, rejectResult, onTaskFinished } = workerData;
try {
if (error) {
const { message, stack, code, name } = error;
const responseError = new Error(message);
Obj... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | onMessage | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function close(error, result) {
if (error) {
rejectResult(error);
} else {
resolveResult(result);
}
if (writer) {
writer.releaseLock();
}
onTaskFinished();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | close | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function runWorker(stream, workerOptions) {
const { options, config } = workerOptions;
const { transferStreams, useWebWorkers, useCompressionStream, codecType, compressed, signed, encrypted } = options;
const { workerScripts, maxWorkers } = config;
workerOptions.transferStreams = transferStreams || transf... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | runWorker | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function getWorker() {
const workerData = pool.find(workerData => !workerData.busy);
if (workerData) {
clearTerminateTimeout(workerData);
return new CodecWorker(workerData, stream, workerOptions, onTaskFinished);
} else if (pool.length < maxWorkers) {
const workerData = { indexWorker };
i... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getWorker | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function onTaskFinished(workerData) {
if (pendingRequests.length) {
const [{ resolve, stream, workerOptions }] = pendingRequests.splice(0, 1);
resolve(new CodecWorker(workerData, stream, workerOptions, onTaskFinished));
} else if (workerData.worker) {
clearTerminateTimeout(workerData);
terminateWo... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | onTaskFinished | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function terminateWorker(workerData, workerOptions) {
const { config } = workerOptions;
const { terminateWorkerTimeout } = config;
if (Number.isFinite(terminateWorkerTimeout) && terminateWorkerTimeout >= 0) {
if (workerData.terminated) {
workerData.terminated = false;
} else {
workerData.terminateTi... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | terminateWorker | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function clearTerminateTimeout(workerData) {
const { terminateTimeout } = workerData;
if (terminateTimeout) {
clearTimeout(terminateTimeout);
workerData.terminateTimeout = null;
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | clearTerminateTimeout | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function terminateWorkers() {
await Promise.allSettled(pool.map(workerData => {
clearTerminateTimeout(workerData);
return workerData.terminate();
}));
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | terminateWorkers | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor() {
this.size = 0;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
init() {
this.initialized = true;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | init | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get readable() {
const reader = this;
const { chunkSize = DEFAULT_CHUNK_SIZE } = reader;
const readable = new ReadableStream({
start() {
this.chunkOffset = 0;
},
async pull(controller) {
const { offset = 0, size, diskNumberStart } = readable;
const { chunkOffset } = this;
const ... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readable | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
start() {
this.chunkOffset = 0;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | start | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async pull(controller) {
const { offset = 0, size, diskNumberStart } = readable;
const { chunkOffset } = this;
const dataSize = size === UNDEFINED_VALUE ? chunkSize : Math.min(chunkSize, size - chunkOffset);
const data = await readUint8Array(reader, offset + chunkOffset, dataSize, diskNumberStart);
... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | pull | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor() {
super();
const writer = this;
const writable = new WritableStream({
write(chunk) {
if (!writer.initialized) {
throw new Error(ERR_WRITER_NOT_INITIALIZED);
}
return writer.writeUint8Array(chunk);
}
});
Object.defineProperty(writer, PROPERTY_NAME_WRITABLE, {
... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
write(chunk) {
if (!writer.initialized) {
throw new Error(ERR_WRITER_NOT_INITIALIZED);
}
return writer.writeUint8Array(chunk);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | write | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get() {
return writable;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | get | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
writeUint8Array() {
// abstract
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | writeUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(dataURI) {
super();
let dataEnd = dataURI.length;
while (dataURI.charAt(dataEnd - 1) == "=") {
dataEnd--;
}
const dataStart = dataURI.indexOf(",") + 1;
Object.assign(this, {
dataURI,
dataStart,
size: Math.floor((dataEnd - dataStart) * 0.75)
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
readUint8Array(offset, length) {
const {
dataStart,
dataURI
} = this;
const dataArray = new Uint8Array(length);
const start = Math.floor(offset / 3) * 4;
const bytes = atob(dataURI.substring(start + dataStart, Math.ceil((offset + length) / 3) * 4 + dataStart));
const delta = offset - Math.floo... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(contentType) {
super();
Object.assign(this, {
data: "data:" + (contentType || "") + ";base64,",
pending: []
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
writeUint8Array(array) {
const writer = this;
let indexArray = 0;
let dataString = writer.pending;
const delta = writer.pending.length;
writer.pending = "";
for (indexArray = 0; indexArray < (Math.floor((delta + array.length) / 3) * 3) - delta; indexArray++) {
dataString += String.fromCharCode(arr... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | writeUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
getData() {
return this.data + btoa(this.pending);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(blob) {
super();
Object.assign(this, {
blob,
size: blob.size
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async readUint8Array(offset, length) {
const reader = this;
const offsetEnd = offset + length;
const blob = offset || offsetEnd < reader.size ? reader.blob.slice(offset, offsetEnd) : reader.blob;
let arrayBuffer = await blob.arrayBuffer();
if (arrayBuffer.byteLength > length) {
arrayBuffer = arrayBuf... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(contentType) {
super();
const writer = this;
const transformStream = new TransformStream();
const headers = [];
if (contentType) {
headers.push([HTTP_HEADER_CONTENT_TYPE, contentType]);
}
Object.defineProperty(writer, PROPERTY_NAME_WRITABLE, {
get() {
return transformStream... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get() {
return transformStream.writable;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | get | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
getData() {
return this.blob;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(text) {
super(new Blob([text], { type: CONTENT_TYPE_TEXT_PLAIN }));
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(encoding) {
super(encoding);
Object.assign(this, {
encoding,
utf8: !encoding || encoding.toLowerCase() == "utf-8"
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async getData() {
const {
encoding,
utf8
} = this;
const blob = await super.getData();
if (blob.text && utf8) {
return blob.text();
} else {
const reader = new FileReader();
return new Promise((resolve, reject) => {
Object.assign(reader, {
onload: ({ target }) => resolve(ta... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(url, options) {
super();
createHttpReader(this, url, options);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async init() {
await initHttpReader(this, sendFetchRequest, getFetchRequestData);
super.init();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | init | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
readUint8Array(index, length) {
return readUint8ArrayHttpReader(this, index, length, sendFetchRequest, getFetchRequestData);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(url, options) {
super();
createHttpReader(this, url, options);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async init() {
await initHttpReader(this, sendXMLHttpRequest, getXMLHttpRequestData);
super.init();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | init | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
readUint8Array(index, length) {
return readUint8ArrayHttpReader(this, index, length, sendXMLHttpRequest, getXMLHttpRequestData);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function createHttpReader(httpReader, url, options) {
const {
preventHeadRequest,
useRangeHeader,
forceRangeRequests,
combineSizeEocd
} = options;
options = Object.assign({}, options);
delete options.preventHeadRequest;
delete options.useRangeHeader;
delete options.forceRangeRequests;
delete o... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createHttpReader | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function initHttpReader(httpReader, sendRequest, getRequestData) {
const {
url,
preventHeadRequest,
useRangeHeader,
forceRangeRequests,
combineSizeEocd
} = httpReader;
if (isHttpFamily(url) && (useRangeHeader || forceRangeRequests) && (typeof preventHeadRequest == "undefined" || preventHeadRe... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | initHttpReader | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function readUint8ArrayHttpReader(httpReader, index, length, sendRequest, getRequestData) {
const {
useRangeHeader,
forceRangeRequests,
eocdCache,
size,
options
} = httpReader;
if (useRangeHeader || forceRangeRequests) {
if (eocdCache && index == size - END_OF_CENTRAL_DIR_LENGTH && length ... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8ArrayHttpReader | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function getRangeHeaders(httpReader, index = 0, length = 1) {
return Object.assign({}, getHeaders(httpReader), { [HTTP_HEADER_RANGE]: HTTP_RANGE_UNIT + "=" + (index < 0 ? index : index + "-" + (index + length - 1)) });
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getRangeHeaders | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function getHeaders({ options }) {
const { headers } = options;
if (headers) {
if (Symbol.iterator in headers) {
return Object.fromEntries(headers);
} else {
return headers;
}
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getHeaders | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function getFetchRequestData(httpReader) {
await getRequestData(httpReader, sendFetchRequest);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getFetchRequestData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function getXMLHttpRequestData(httpReader) {
await getRequestData(httpReader, sendXMLHttpRequest);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getXMLHttpRequestData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function getRequestData(httpReader, sendRequest) {
const response = await sendRequest(HTTP_METHOD_GET, httpReader, getHeaders(httpReader));
httpReader.data = new Uint8Array(await response.arrayBuffer());
if (!httpReader.size) {
httpReader.size = httpReader.data.length;
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getRequestData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function getContentLength(httpReader, sendRequest, getRequestData) {
if (httpReader.preventHeadRequest) {
await getRequestData(httpReader, httpReader.options);
} else {
const response = await sendRequest(HTTP_METHOD_HEAD, httpReader, getHeaders(httpReader));
const contentLength = response.headers.get... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getContentLength | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function sendFetchRequest(method, { options, url }, headers) {
const response = await fetch(url, Object.assign({}, options, { method, headers }));
if (response.status < 400) {
return response;
} else {
throw response.status == 416 ? new Error(ERR_HTTP_RANGE) : new Error(ERR_HTTP_STATUS + (response.sta... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | sendFetchRequest | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
function sendXMLHttpRequest(method, { url }, headers) {
return new Promise((resolve, reject) => {
const request = new XMLHttpRequest();
request.addEventListener("load", () => {
if (request.status < 400) {
const headers = [];
request.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(header =>... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | sendXMLHttpRequest | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(url, options = {}) {
super();
Object.assign(this, {
url,
reader: options.useXHR ? new XHRReader(url, options) : new FetchReader(url, options)
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
set size(value) {
// ignored
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | size | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get size() {
return this.reader.size;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | size | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async init() {
await this.reader.init();
super.init();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | init | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
readUint8Array(index, length) {
return this.reader.readUint8Array(index, length);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(url, options = {}) {
options.useRangeHeader = true;
super(url, options);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(array) {
super();
Object.assign(this, {
array,
size: array.length
});
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
readUint8Array(index, length) {
return this.array.slice(index, index + length);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
init(initSize = 0) {
Object.assign(this, {
offset: 0,
array: new Uint8Array(initSize)
});
super.init();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | init | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
writeUint8Array(array) {
const writer = this;
if (writer.offset + array.length > writer.array.length) {
const previousArray = writer.array;
writer.array = new Uint8Array(previousArray.length + array.length);
writer.array.set(previousArray);
}
writer.array.set(array, writer.offset);
writer.off... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | writeUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
getData() {
return this.array;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getData | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(readers) {
super();
this.readers = readers;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async init() {
const reader = this;
const { readers } = reader;
reader.lastDiskNumber = 0;
reader.lastDiskOffset = 0;
await Promise.all(readers.map(async (diskReader, indexDiskReader) => {
await diskReader.init();
if (indexDiskReader != readers.length - 1) {
reader.lastDiskOffset += diskRead... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | init | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async readUint8Array(offset, length, diskNumber = 0) {
const reader = this;
const { readers } = this;
let result;
let currentDiskNumber = diskNumber;
if (currentDiskNumber == -1) {
currentDiskNumber = readers.length - 1;
}
let currentReaderOffset = offset;
while (currentReaderOffset >= reade... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | readUint8Array | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
constructor(writerGenerator, maxSize = 4294967295) {
super();
const writer = this;
Object.assign(writer, {
diskNumber: 0,
diskOffset: 0,
size: 0,
maxSize,
availableSize: maxSize
});
let diskSourceWriter, diskWritable, diskWriter;
const writable = new WritableStream({
async writ... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async write(chunk) {
const { availableSize } = writer;
if (!diskWriter) {
const { value, done } = await writerGenerator.next();
if (done && !value) {
throw new Error(ERR_ITERATOR_COMPLETED_TOO_SOON);
} else {
diskSourceWriter = value;
diskSourceWriter.size = 0;
if... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | write | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async close() {
await diskWriter.ready;
await closeDisk();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | close | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
get() {
return writable;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | get | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function writeChunk(chunk) {
const chunkLength = chunk.length;
if (chunkLength) {
await diskWriter.ready;
await diskWriter.write(chunk);
diskSourceWriter.size += chunkLength;
writer.size += chunkLength;
writer.availableSize -= chunkLength;
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | writeChunk | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
async function closeDisk() {
diskWritable.size = diskSourceWriter.size;
await diskWriter.close();
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | closeDisk | javascript | gildas-lormeau/zip.js | dist/zip-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-full.js | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.