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 |
|---|---|---|---|---|---|---|---|
function getRandomValues(array) {
if (GET_RANDOM_VALUES_SUPPORTED) {
return crypto.getRandomValues(array);
} else {
return random.getRandomValues(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. | getRandomValues | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
constructor({ password, rawPassword, signed, encryptionStrength, checkPasswordOnly }) {
super({
start() {
Object.assign(this, {
ready: new Promise(resolve => this.resolveReady = resolve),
password: encodePassword(password, rawPassword),
signed,
strength: encryptionStrength - 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. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
start() {
Object.assign(this, {
ready: new Promise(resolve => this.resolveReady = resolve),
password: encodePassword(password, rawPassword),
signed,
strength: encryptionStrength - 1,
pending: new Uint8Array()
});
} | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async transform(chunk, controller) {
const aesCrypto = this;
const {
password,
strength,
resolveReady,
ready
} = aesCrypto;
if (password) {
await createDecryptionKeys(aesCrypto, strength, password, subarray(chunk, 0, SALT_LENGTH[strength] + 2));
chunk = subarray(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. | transform | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async flush(controller) {
const {
signed,
ctr,
hmac,
pending,
ready
} = this;
if (hmac && ctr) {
await ready;
const chunkToDecrypt = subarray(pending, 0, pending.length - SIGNATURE_LENGTH);
const originalSignature = subarray(pending, pending.length - SIGNAT... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
constructor({ password, rawPassword, encryptionStrength }) {
// deno-lint-ignore prefer-const
let stream;
super({
start() {
Object.assign(this, {
ready: new Promise(resolve => this.resolveReady = resolve),
password: encodePassword(password, rawPassword),
strength: encryptionStrength ... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
start() {
Object.assign(this, {
ready: new Promise(resolve => this.resolveReady = resolve),
password: encodePassword(password, rawPassword),
strength: encryptionStrength - 1,
pending: new Uint8Array()
});
} | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async transform(chunk, controller) {
const aesCrypto = this;
const {
password,
strength,
resolveReady,
ready
} = aesCrypto;
let preamble = new Uint8Array();
if (password) {
preamble = await createEncryptionKeys(aesCrypto, strength, password);
resolveReady();
... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async flush(controller) {
const {
ctr,
hmac,
pending,
ready
} = this;
if (hmac && ctr) {
await ready;
let encryptedChunkArray = new Uint8Array();
if (pending.length) {
const encryptedChunk = ctr.update(toBits(codecBytes, pending));
hmac.update(encry... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function append(aesCrypto, input, output, paddingStart, paddingEnd, verifySignature) {
const {
ctr,
hmac,
pending
} = aesCrypto;
const inputLength = input.length - paddingEnd;
if (pending.length) {
input = concat(pending, input);
output = expand(output, inputLength - (inputLength % BLOCK_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. | append | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async function createDecryptionKeys(decrypt, strength, password, preamble) {
const passwordVerificationKey = await createKeys$1(decrypt, strength, password, subarray(preamble, 0, SALT_LENGTH[strength]));
const passwordVerification = subarray(preamble, SALT_LENGTH[strength]);
if (passwordVerificationKey[0] != pass... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createDecryptionKeys | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async function createEncryptionKeys(encrypt, strength, password) {
const salt = getRandomValues(new Uint8Array(SALT_LENGTH[strength]));
const passwordVerification = await createKeys$1(encrypt, strength, password, salt);
return concat(salt, passwordVerification);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createEncryptionKeys | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async function createKeys$1(aesCrypto, strength, password, salt) {
aesCrypto.password = null;
const baseKey = await importKey(RAW_FORMAT, password, BASE_KEY_ALGORITHM, false, DERIVED_BITS_USAGE);
const derivedBits = await deriveBits(Object.assign({ salt }, DERIVED_BITS_ALGORITHM), baseKey, 8 * ((KEY_LENGTH[streng... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createKeys$1 | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async function importKey(format, password, algorithm, extractable, keyUsages) {
if (IMPORT_KEY_SUPPORTED) {
try {
return await subtle.importKey(format, password, algorithm, extractable, keyUsages);
// eslint-disable-next-line no-unused-vars
} catch (_) {
IMPORT_KEY_SUPPORTED = false;
return misc... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | importKey | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
async function deriveBits(algorithm, baseKey, length) {
if (DERIVE_BITS_SUPPORTED) {
try {
return await subtle.deriveBits(algorithm, baseKey, length);
// eslint-disable-next-line no-unused-vars
} catch (_) {
DERIVE_BITS_SUPPORTED = false;
return misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | deriveBits | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function encodePassword(password, rawPassword) {
if (rawPassword === UNDEFINED_VALUE) {
return encodeText(password);
} else {
return rawPassword;
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | encodePassword | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function concat(leftArray, rightArray) {
let array = leftArray;
if (leftArray.length + rightArray.length) {
array = new Uint8Array(leftArray.length + rightArray.length);
array.set(leftArray, 0);
array.set(rightArray, leftArray.length);
}
return 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. | concat | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function expand(inputArray, length) {
if (length && length > inputArray.length) {
const array = inputArray;
inputArray = new Uint8Array(length);
inputArray.set(array, 0);
}
return inputArray;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | expand | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function subarray(array, begin, end) {
return array.subarray(begin, end);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | subarray | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function fromBits(codecBytes, chunk) {
return codecBytes.fromBits(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. | fromBits | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function toBits(codecBytes, chunk) {
return codecBytes.toBits(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. | toBits | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
constructor({ password, passwordVerification, checkPasswordOnly }) {
super({
start() {
Object.assign(this, {
password,
passwordVerification
});
createKeys(this, password);
},
transform(chunk, controller) {
const zipCrypto = this;
if (zipCrypto.password) {
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. | constructor | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
start() {
Object.assign(this, {
password,
passwordVerification
});
createKeys(this, password);
} | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
transform(chunk, controller) {
const zipCrypto = this;
if (zipCrypto.password) {
const decryptedHeader = decrypt(zipCrypto, chunk.subarray(0, HEADER_LENGTH));
zipCrypto.password = null;
if (decryptedHeader[HEADER_LENGTH - 1] != zipCrypto.passwordVerification) {
throw new Error(ERR_INV... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
constructor({ password, passwordVerification }) {
super({
start() {
Object.assign(this, {
password,
passwordVerification
});
createKeys(this, password);
},
transform(chunk, controller) {
const zipCrypto = this;
let output;
let offset;
if (zipCrypto.password)... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
start() {
Object.assign(this, {
password,
passwordVerification
});
createKeys(this, password);
} | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
transform(chunk, controller) {
const zipCrypto = this;
let output;
let offset;
if (zipCrypto.password) {
zipCrypto.password = null;
const header = getRandomValues(new Uint8Array(HEADER_LENGTH));
header[HEADER_LENGTH - 1] = zipCrypto.passwordVerification;
output = new Uint8Arr... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function decrypt(target, input) {
const output = new Uint8Array(input.length);
for (let index = 0; index < input.length; index++) {
output[index] = getByte(target) ^ input[index];
updateKeys(target, output[index]);
}
return output;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | decrypt | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function encrypt(target, input) {
const output = new Uint8Array(input.length);
for (let index = 0; index < input.length; index++) {
output[index] = getByte(target) ^ input[index];
updateKeys(target, input[index]);
}
return output;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | encrypt | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function createKeys(target, password) {
const keys = [0x12345678, 0x23456789, 0x34567890];
Object.assign(target, {
keys,
crcKey0: new Crc32(keys[0]),
crcKey2: new Crc32(keys[2]),
});
for (let index = 0; index < password.length; index++) {
updateKeys(target, password.charCodeAt(index));
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createKeys | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function updateKeys(target, byte) {
let [key0, key1, key2] = target.keys;
target.crcKey0.append([byte]);
key0 = ~target.crcKey0.get();
key1 = getInt32(Math.imul(getInt32(key1 + getInt8(key0)), 134775813) + 1);
target.crcKey2.append([key1 >>> 24]);
key2 = ~target.crcKey2.get();
target.keys = [key0, key1, k... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | updateKeys | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function getByte(target) {
const temp = target.keys[2] | 2;
return getInt8(Math.imul(temp, (temp ^ 1)) >>> 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. | getByte | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function getInt8(number) {
return number & 0xFF;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getInt8 | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function getInt32(number) {
return number & 0xFFFFFFFF;
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getInt32 | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
constructor(options, { chunkSize, CompressionStream, CompressionStreamNative }) {
super({});
const { compressed, encrypted, useCompressionStream, zipCrypto, signed, level } = options;
const stream = this;
let crc32Stream, encryptionStream;
let readable = filterEmptyChunks(super.readable);
if ((!encryp... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function initShimAsyncCodec(library, options = {}, registerDataHandler) {
return {
Deflate: createCodecClass(library.Deflate, options.deflate, registerDataHandler),
Inflate: createCodecClass(library.Inflate, options.inflate, registerDataHandler)
};
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | initShimAsyncCodec | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function objectHasOwn(object, propertyName) {
return typeof Object.hasOwn === FUNCTION_TYPE ?
Object.hasOwn(object, propertyName) :
object.hasOwnProperty(propertyName);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | objectHasOwn | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function createCodecClass(constructor, constructorOptions, registerDataHandler) {
return class {
constructor(options) {
const codecAdapter = this;
const onData = data => {
if (codecAdapter.pendingData) {
const previousPendingData = codecAdapter.pendingData;
codecAdapter.pendingData = new ... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | createCodecClass | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
constructor(options) {
const codecAdapter = this;
const onData = data => {
if (codecAdapter.pendingData) {
const previousPendingData = codecAdapter.pendingData;
codecAdapter.pendingData = new Uint8Array(previousPendingData.length + data.length);
const { pendingData } = codecAdapter;
... | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
onData = data => {
if (codecAdapter.pendingData) {
const previousPendingData = codecAdapter.pendingData;
codecAdapter.pendingData = new Uint8Array(previousPendingData.length + data.length);
const { pendingData } = codecAdapter;
pendingData.set(previousPendingData, 0);
pendingData.set(... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | onData | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
onData = data => {
if (codecAdapter.pendingData) {
const previousPendingData = codecAdapter.pendingData;
codecAdapter.pendingData = new Uint8Array(previousPendingData.length + data.length);
const { pendingData } = codecAdapter;
pendingData.set(previousPendingData, 0);
pendingData.set(... | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | onData | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
append(data) {
this.codec.push(data);
return getResponse(this);
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | append | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
flush() {
this.codec.push(new Uint8Array(), true);
return getResponse(this);
} | 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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-full.js | BSD-3-Clause |
function getResponse(codec) {
if (codec.pendingData) {
const output = codec.pendingData;
codec.pendingData = null;
return output;
} else {
return new Uint8Array();
}
} | HMAC with the specified hash function.
@constructor
@param {bitArray} key the key for HMAC.
@param {Object} [Hash=hash.sha1] The hash function to use. | getResponse | javascript | gildas-lormeau/zip.js | dist/zip-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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-fs-full.js | https://github.com/gildas-lormeau/zip.js/blob/master/dist/zip-fs-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.