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

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

@ -0,0 +1,21 @@
/// <reference types="node" />
import { HashInput } from '../node/hash-fn';
import { IBaseHashOptions } from '../base/hash-fn';
/**
* @hidden
*/
export declare const normalizeInput: (input: HashInput, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => Buffer;
/**
* 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;

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

@ -0,0 +1,51 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const native_1 = __importDefault(require("./native"));
const hash_fn_1 = require("../base/hash-fn");
/**
* @hidden
*/
exports.normalizeInput = (input, encoding) => {
if (input instanceof Buffer) {
return input;
}
if (typeof input === 'string') {
return Buffer.from(input, encoding);
}
return Buffer.from(input);
};
/**
* Returns a blake3 hash of the input, returning the binary hash data.
*/
function hash(input, { length = hash_fn_1.defaultHashLength } = {}) {
return native_1.default.hash(exports.normalizeInput(input), length);
}
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 hasher = new native_1.default.Hasher(undefined, context);
hasher.update(exports.normalizeInput(material));
const result = Buffer.alloc(length);
hasher.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 } = {}) {
const hasher = new native_1.default.Hasher(key);
hasher.update(exports.normalizeInput(input));
const result = Buffer.alloc(length);
hasher.digest(result);
return result;
}
exports.keyedHash = keyedHash;
//# sourceMappingURL=hash-fn.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"hash-fn.js","sourceRoot":"","sources":["../../ts/node-native/hash-fn.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAE9B,6CAAsE;AAEtE;;GAEG;AACU,QAAA,cAAc,GAAG,CAAC,KAAgB,EAAE,QAAyB,EAAU,EAAE;IACpF,IAAI,KAAK,YAAY,MAAM,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;KACrC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,KAAmB,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF;;GAEG;AACH,SAAgB,IAAI,CAClB,KAAgB,EAChB,EAAE,MAAM,GAAG,2BAAiB,KAAuB,EAAE;IAErD,OAAO,gBAAM,CAAC,IAAI,CAAC,sBAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AALD,oBAKC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CACvB,OAAe,EACf,QAAmB,EACnB,EAAE,MAAM,GAAG,2BAAiB,KAAuB,EAAE;IAErD,MAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACrD,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,MAAM,MAAM,GAAG,IAAI,gBAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACtC,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;AAVD,8BAUC"}

View file

@ -0,0 +1,15 @@
/// <reference types="node" />
import { INativeReader } from './native';
import { NodeHash } from '../node/hash-instance';
/**
* A Node.js crypto-like createHash method.
*/
export declare const createHash: () => NodeHash<INativeReader>;
/**
* Construct a new Hasher for the keyed hash function.
*/
export declare const createKeyed: (key: Buffer) => NodeHash<INativeReader>;
/**
* Construct a new Hasher for the key derivation function.
*/
export declare const createDeriveKey: (context: string) => NodeHash<INativeReader>;

View file

@ -0,0 +1,31 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const native_1 = __importDefault(require("./native"));
const hash_instance_1 = require("../node/hash-instance");
const hash_reader_1 = require("../node/hash-reader");
// A buffer we reuse for sending bigints. set_position is synchronous, so
// this just saves creating garbage.
const bigIntBuffer = Buffer.alloc(8);
const readerFactory = (r) => new hash_reader_1.NodeHashReader({
fill: target => r.fill(target),
set_position: position => {
bigIntBuffer.writeBigUInt64BE(position);
r.set_position(bigIntBuffer);
},
});
/**
* A Node.js crypto-like createHash method.
*/
exports.createHash = () => new hash_instance_1.NodeHash(new native_1.default.Hasher(), readerFactory);
/**
* Construct a new Hasher for the keyed hash function.
*/
exports.createKeyed = (key) => new hash_instance_1.NodeHash(new native_1.default.Hasher(key), readerFactory);
/**
* Construct a new Hasher for the key derivation function.
*/
exports.createDeriveKey = (context) => new hash_instance_1.NodeHash(new native_1.default.Hasher(undefined, context), readerFactory);
//# sourceMappingURL=hash-instance.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"hash-instance.js","sourceRoot":"","sources":["../../ts/node-native/hash-instance.ts"],"names":[],"mappings":";;;;;AAAA,sDAAiD;AACjD,yDAAiD;AACjD,qDAAqD;AAErD,yEAAyE;AACzE,oCAAoC;AACpC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAErC,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAE,EAAE,CACzC,IAAI,4BAAc,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC9B,YAAY,EAAE,QAAQ,CAAC,EAAE;QACvB,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC,CAAC;AAEL;;GAEG;AACU,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,wBAAQ,CAAC,IAAI,gBAAM,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC;AAEjF;;GAEG;AACU,QAAA,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,wBAAQ,CAAC,IAAI,gBAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;AAEhG;;GAEG;AACU,QAAA,eAAe,GAAG,CAAC,OAAe,EAAE,EAAE,CACjD,IAAI,wBAAQ,CAAC,IAAI,gBAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC"}

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

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

13
node_modules/blake3-wasm/dist/node-native/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("../node/hash-reader"));
__export(require("./hash-instance"));
__export(require("../base/index"));
//# sourceMappingURL=index.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/node-native/index.ts"],"names":[],"mappings":";;;;;AACA,qCAAuD;AAA9C,yBAAA,IAAI,CAAA;AAAE,8BAAA,SAAS,CAAA;AAAE,8BAAA,SAAS,CAAA;AACnC,yCAAoC;AACpC,qCAAgC;AAChC,mCAA8B"}

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

@ -0,0 +1,16 @@
/// <reference types="node" />
import { IInternalHash } from '../base/index';
export interface INativeReader {
free?(): void;
fill(target: Uint8Array): void;
set_position(position: Buffer): void;
}
export interface INativeHash extends IInternalHash<INativeReader> {
new (hashKey?: Buffer, context?: string): INativeHash;
}
export interface INativeModule {
Hasher: INativeHash;
hash(input: Buffer, length: number): Buffer;
}
declare const native: INativeModule;
export default native;

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

@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const native = require('../native.node');
exports.default = native;
//# sourceMappingURL=native.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../ts/node-native/native.ts"],"names":[],"mappings":";;AAiBA,MAAM,MAAM,GAAkB,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAExD,kBAAe,MAAM,CAAC"}