Initial commit (by create-cloudflare CLI)

This commit is contained in:
J-onasJones 2023-09-14 18:58:13 +02:00
commit 58a42872a0
1745 changed files with 741893 additions and 0 deletions

24
node_modules/blake3-wasm/dist/node/hash-fn.d.ts generated vendored Normal file
View file

@ -0,0 +1,24 @@
/// <reference types="node" />
import { BaseHashInput, IBaseHashOptions } from '../base/hash-fn';
/**
* Input used for node-based hashes.
*/
export declare type HashInput = BaseHashInput | string;
/**
* @hidden
*/
export declare const normalizeInput: (input: HashInput, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => Uint8Array;
/**
* Returns a blake3 hash of the input, returning the binary hash data.
*/
export declare function hash(input: HashInput, { length }?: IBaseHashOptions): Buffer | string;
/**
* Given cryptographic key material and a context string, services a subkey of
* any length. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.derive_key.html}
* for more information.
*/
export declare function deriveKey(context: string, material: HashInput, { length }?: IBaseHashOptions): Buffer;
/**
* The keyed hash function. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.keyed_hash.html}.
*/
export declare function keyedHash(key: Buffer, input: HashInput, { length }?: IBaseHashOptions): Buffer;

45
node_modules/blake3-wasm/dist/node/hash-fn.js generated vendored Normal file
View file

@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hash_fn_1 = require("../base/hash-fn");
const blake3_js_1 = require("../../dist/wasm/nodejs/blake3_js");
/**
* @hidden
*/
exports.normalizeInput = (input, encoding) => hash_fn_1.inputToArray(typeof input === 'string' ? Buffer.from(input, encoding) : input);
/**
* Returns a blake3 hash of the input, returning the binary hash data.
*/
function hash(input, { length = hash_fn_1.defaultHashLength } = {}) {
const result = Buffer.alloc(length);
blake3_js_1.hash(exports.normalizeInput(input), result);
return result;
}
exports.hash = hash;
/**
* Given cryptographic key material and a context string, services a subkey of
* any length. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.derive_key.html}
* for more information.
*/
function deriveKey(context, material, { length = hash_fn_1.defaultHashLength } = {}) {
const derive = blake3_js_1.create_derive(context);
derive.update(exports.normalizeInput(material));
const result = Buffer.alloc(length);
derive.digest(result);
return result;
}
exports.deriveKey = deriveKey;
/**
* The keyed hash function. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.keyed_hash.html}.
*/
function keyedHash(key, input, { length = hash_fn_1.defaultHashLength } = {}) {
if (key.length !== 32) {
throw new Error(`key provided to keyedHash must be 32 bytes, got ${key.length}`);
}
const derive = blake3_js_1.create_keyed(key);
derive.update(exports.normalizeInput(input));
const result = Buffer.alloc(length);
derive.digest(result);
return result;
}
exports.keyedHash = keyedHash;
//# sourceMappingURL=hash-fn.js.map

1
node_modules/blake3-wasm/dist/node/hash-fn.js.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"hash-fn.js","sourceRoot":"","sources":["../../ts/node/hash-fn.ts"],"names":[],"mappings":";;AAAA,6CAAmG;AACnG,gEAI0C;AAO1C;;GAEG;AACU,QAAA,cAAc,GAAG,CAAC,KAAgB,EAAE,QAAyB,EAAc,EAAE,CACxF,sBAAY,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAEjF;;GAEG;AACH,SAAgB,IAAI,CAClB,KAAgB,EAChB,EAAE,MAAM,GAAG,2BAAiB,KAAuB,EAAE;IAErD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,gBAAO,CAAC,sBAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,oBAOC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CACvB,OAAe,EACf,QAAmB,EACnB,EAAE,MAAM,GAAG,2BAAiB,KAAuB,EAAE;IAErD,MAAM,MAAM,GAAG,yBAAY,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC;AAVD,8BAUC;AAED;;GAEG;AACH,SAAgB,SAAS,CACvB,GAAW,EACX,KAAgB,EAChB,EAAE,MAAM,GAAG,2BAAiB,KAAuB,EAAE;IAErD,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,mDAAmD,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;KAClF;IAED,MAAM,MAAM,GAAG,wBAAW,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC;AAdD,8BAcC"}

75
node_modules/blake3-wasm/dist/node/hash-instance.d.ts generated vendored Normal file
View file

@ -0,0 +1,75 @@
/// <reference types="node" />
import { HashInput } from './hash-fn';
import { IHasher, IInternalHash, IHasherDigestOptions } from '../base/index';
import { Transform, TransformCallback } from 'stream';
import { IBaseHashOptions } from '../base/hash-fn';
import { NodeHashReader } from './hash-reader';
export interface INodeHash extends IHasher<Buffer> {
/**
* @inheritdoc
* @override
*/
update(data: HashInput, encoding?: BufferEncoding): this;
/**
* @inheritdoc
* @override
*/
digest(options?: IBaseHashOptions): Buffer;
/**
* Returns a digest of the hash with the given set of hash options.
*/
digest(encoding: undefined, options: IBaseHashOptions): Buffer;
/**
* Returns a digest of the hash with the given encoding.
*/
digest(encoding: BufferEncoding, options?: IBaseHashOptions): string;
}
/**
* @inheritdoc
*/
export declare class NodeHash<Reader> extends Transform implements IHasher<Buffer> {
private readonly hash;
constructor(implementation: IInternalHash<Reader>, getReader: (r: Reader) => NodeHashReader);
/**
* @reader
*/
reader(options?: {
dispose?: boolean;
}): NodeHashReader;
/**
* @inheritdoc
*/
update(data: HashInput, encoding?: BufferEncoding): this;
/**
* @inheritdoc
*/
digest(encoding?: IHasherDigestOptions): Buffer;
digest(encoding: undefined, options: IHasherDigestOptions): Buffer;
digest(encoding: BufferEncoding, options?: IHasherDigestOptions): string;
/**
* @inheritdoc
*/
dispose(): void;
/**
* @inheritdoc
* @hidden
*/
_transform(chunk: Buffer | string, encoding: string, callback: TransformCallback): void;
/**
* @inheritdoc
* @hidden
*/
_flush(callback: TransformCallback): void;
}
/**
* A Node.js crypto-like createHash method.
*/
export declare const createHash: () => NodeHash<import("../../dist/wasm/nodejs/blake3_js").HashReader>;
/**
* Construct a new Hasher for the keyed hash function.
*/
export declare const createKeyed: (key: Buffer) => NodeHash<import("../../dist/wasm/nodejs/blake3_js").HashReader>;
/**
* Construct a new Hasher for the key derivation function.
*/
export declare const createDeriveKey: (context: string) => NodeHash<import("../../dist/wasm/nodejs/blake3_js").HashReader>;

79
node_modules/blake3-wasm/dist/node/hash-instance.js generated vendored Normal file
View file

@ -0,0 +1,79 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hash_fn_1 = require("./hash-fn");
const index_1 = require("../base/index");
const stream_1 = require("stream");
const wasm_1 = require("./wasm");
const hash_reader_1 = require("./hash-reader");
/**
* @inheritdoc
*/
class NodeHash extends stream_1.Transform {
constructor(implementation, getReader) {
super();
this.hash = new index_1.BaseHash(implementation, l => Buffer.alloc(l), getReader);
}
/**
* @reader
*/
reader(options) {
const reader = this.hash.reader(options);
return reader;
}
/**
* @inheritdoc
*/
update(data, encoding) {
this.hash.update(hash_fn_1.normalizeInput(data, encoding));
return this;
}
digest(encoding, options) {
let resolvedOpts;
let resolvedEnc;
if (encoding && typeof encoding === 'object') {
resolvedOpts = encoding;
resolvedEnc = undefined;
}
else {
resolvedOpts = options;
resolvedEnc = encoding;
}
const result = this.hash.digest(resolvedOpts);
return resolvedEnc ? result.toString(resolvedEnc) : result;
}
/**
* @inheritdoc
*/
dispose() {
this.hash.dispose();
}
/**
* @inheritdoc
* @hidden
*/
_transform(chunk, encoding, callback) {
this.update(chunk, encoding);
callback();
}
/**
* @inheritdoc
* @hidden
*/
_flush(callback) {
callback(null, this.digest());
}
}
exports.NodeHash = NodeHash;
/**
* A Node.js crypto-like createHash method.
*/
exports.createHash = () => new NodeHash(wasm_1.getWasm().create_hasher(), r => new hash_reader_1.NodeHashReader(r));
/**
* Construct a new Hasher for the keyed hash function.
*/
exports.createKeyed = (key) => new NodeHash(wasm_1.getWasm().create_keyed(key), r => new hash_reader_1.NodeHashReader(r));
/**
* Construct a new Hasher for the key derivation function.
*/
exports.createDeriveKey = (context) => new NodeHash(wasm_1.getWasm().create_derive(context), r => new hash_reader_1.NodeHashReader(r));
//# sourceMappingURL=hash-instance.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"hash-instance.js","sourceRoot":"","sources":["../../ts/node/hash-instance.ts"],"names":[],"mappings":";;AAAA,uCAAsD;AACtD,yCAAuF;AACvF,mCAAsD;AAEtD,iCAAiC;AACjC,+CAA+C;AA0B/C;;GAEG;AACH,MAAa,QAAiB,SAAQ,kBAAS;IAG7C,YAAY,cAAqC,EAAE,SAAwC;QACzF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,gBAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzC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AAC,CAAC,CAAC;AAEpG;;GAEG;AACU,QAAA,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CACzC,IAAI,QAAQ,CAAC,cAAO,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,4BAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAExE;;GAEG;AACU,QAAA,eAAe,GAAG,CAAC,OAAe,EAAE,EAAE,CACjD,IAAI,QAAQ,CAAC,cAAO,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,4BAAc,CAAC,CAAC,CAAC,CAAC,CAAC"}

16
node_modules/blake3-wasm/dist/node/hash-reader.d.ts generated vendored Normal file
View file

@ -0,0 +1,16 @@
/// <reference types="node" />
import { BaseHashReader } from '../base/hash-reader';
/**
* A hash reader for WebAssembly targets.
*/
export declare class NodeHashReader extends BaseHashReader<Buffer> {
/**
* Converts first 32 bytes of the hash to a string with the given encoding.
*/
toString(encoding?: BufferEncoding): string;
/**
* Converts first 32 bytes of the hash to an array.
*/
toBuffer(): Buffer;
protected alloc(bytes: number): Buffer;
}

27
node_modules/blake3-wasm/dist/node/hash-reader.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hash_reader_1 = require("../base/hash-reader");
const hash_fn_1 = require("../base/hash-fn");
/**
* A hash reader for WebAssembly targets.
*/
class NodeHashReader extends hash_reader_1.BaseHashReader {
/**
* Converts first 32 bytes of the hash to a string with the given encoding.
*/
toString(encoding = 'hex') {
return this.toBuffer().toString(encoding);
}
/**
* Converts first 32 bytes of the hash to an array.
*/
toBuffer() {
this.position = BigInt(0);
return this.read(hash_fn_1.defaultHashLength);
}
alloc(bytes) {
return Buffer.alloc(bytes);
}
}
exports.NodeHashReader = NodeHashReader;
//# sourceMappingURL=hash-reader.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"hash-reader.js","sourceRoot":"","sources":["../../ts/node/hash-reader.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,6CAAoD;AAEpD;;GAEG;AACH,MAAa,cAAe,SAAQ,4BAAsB;IACxD;;OAEG;IACI,QAAQ,CAAC,WAA2B,KAAK;QAC9C,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAiB,CAAC,CAAC;IACtC,CAAC;IAES,KAAK,CAAC,KAAa;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF;AAnBD,wCAmBC"}

4
node_modules/blake3-wasm/dist/node/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,4 @@
export { hash, deriveKey, keyedHash, HashInput } from './hash-fn';
export * from './hash-instance';
export * from './hash-reader';
export * from '../base/index';

13
node_modules/blake3-wasm/dist/node/index.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var hash_fn_1 = require("./hash-fn");
exports.hash = hash_fn_1.hash;
exports.deriveKey = hash_fn_1.deriveKey;
exports.keyedHash = hash_fn_1.keyedHash;
__export(require("./hash-instance"));
__export(require("./hash-reader"));
__export(require("../base/index"));
//# sourceMappingURL=index.js.map

1
node_modules/blake3-wasm/dist/node/index.js.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/node/index.ts"],"names":[],"mappings":";;;;;AAAA,qCAAkE;AAAzD,yBAAA,IAAI,CAAA;AAAE,8BAAA,SAAS,CAAA;AAAE,8BAAA,SAAS,CAAA;AACnC,qCAAgC;AAChC,mCAA8B;AAC9B,mCAA8B"}

6
node_modules/blake3-wasm/dist/node/wasm.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
import * as wasm from '../../dist/wasm/nodejs/blake3_js';
/**
* Lazyily get the WebAssembly module. Used to avoid unnecessarily importing
* the wasm when extending the WebAssembly node code for native bindings.
*/
export declare const getWasm: () => typeof wasm;

14
node_modules/blake3-wasm/dist/node/wasm.js generated vendored Normal file
View file

@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let w;
/**
* Lazyily get the WebAssembly module. Used to avoid unnecessarily importing
* the wasm when extending the WebAssembly node code for native bindings.
*/
exports.getWasm = () => {
if (!w) {
w = require('../../dist/wasm/nodejs/blake3_js');
}
return w;
};
//# sourceMappingURL=wasm.js.map

1
node_modules/blake3-wasm/dist/node/wasm.js.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../ts/node/wasm.ts"],"names":[],"mappings":";;AAEA,IAAI,CAA0B,CAAC;AAE/B;;;GAGG;AACU,QAAA,OAAO,GAAG,GAAG,EAAE;IAC1B,IAAI,CAAC,CAAC,EAAE;QACN,CAAC,GAAG,OAAO,CAAC,kCAAkC,CAAgB,CAAC;KAChE;IAED,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}