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/esm/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;

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

@ -0,0 +1,43 @@
import native from './native.js';
import { defaultHashLength } from '../base/hash-fn.js';
/**
* @hidden
*/
export const 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.
*/
export function hash(input, { length = defaultHashLength } = {}) {
return native.hash(normalizeInput(input), length);
}
/**
* 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 function deriveKey(context, material, { length = defaultHashLength } = {}) {
const hasher = new native.Hasher(undefined, context);
hasher.update(normalizeInput(material));
const result = Buffer.alloc(length);
hasher.digest(result);
return result;
}
/**
* The keyed hash function. See {@link https://docs.rs/blake3/0.1.3/blake3/fn.keyed_hash.html}.
*/
export function keyedHash(key, input, { length = defaultHashLength } = {}) {
const hasher = new native.Hasher(key);
hasher.update(normalizeInput(input));
const result = Buffer.alloc(length);
hasher.digest(result);
return result;
}
//# 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,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAoB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,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,MAAM,UAAU,IAAI,CAClB,KAAgB,EAChB,EAAE,MAAM,GAAG,iBAAiB,KAAuB,EAAE;IAErD,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,OAAe,EACf,QAAmB,EACnB,EAAE,MAAM,GAAG,iBAAiB,KAAuB,EAAE;IAErD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,CAAC,cAAc,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;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CACvB,GAAW,EACX,KAAgB,EAChB,EAAE,MAAM,GAAG,iBAAiB,KAAuB,EAAE;IAErD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,CAAC,cAAc,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"}

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,26 @@
import native from './native.js';
import { NodeHash } from '../node/hash-instance.js';
import { NodeHashReader } from '../node/hash-reader.js';
// 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 NodeHashReader({
fill: target => r.fill(target),
set_position: position => {
bigIntBuffer.writeBigUInt64BE(position);
r.set_position(bigIntBuffer);
},
});
/**
* A Node.js crypto-like createHash method.
*/
export const createHash = () => new NodeHash(new native.Hasher(), readerFactory);
/**
* Construct a new Hasher for the keyed hash function.
*/
export const createKeyed = (key) => new NodeHash(new native.Hasher(key), readerFactory);
/**
* Construct a new Hasher for the key derivation function.
*/
export const createDeriveKey = (context) => new NodeHash(new native.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,OAAO,MAAyB,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;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,cAAc,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;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC;AAEjF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,EAAE,CACjD,IAAI,QAAQ,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC"}

5
node_modules/blake3-wasm/esm/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';

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

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

View file

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/node-native/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}

16
node_modules/blake3-wasm/esm/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;

3
node_modules/blake3-wasm/esm/node-native/native.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
const native = require('../native.node');
export 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,eAAe,MAAM,CAAC"}