UNPKG

nano-pow

Version:

Proof-of-work generation and validation with WebGPU/WebGL/WASM for Nano cryptocurrency.

57 lines (56 loc) 2.04 kB
export * from './api-support'; export * from './bigint'; export * from './cache'; export * from './logger'; export * from './queue'; export declare const SEND: 0xfffffff800000000n; export declare const RECEIVE: 0xfffffe0000000000n; export declare const MAX_HASH: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn; type Averages = { count: number; total: number; rate: number; min: number; max: number; median: number; arithmetic: number; geometric: number; harmonic: number; truncatedCount: number; truncatedTotal: number; truncatedRate: number; truncatedMin: number; truncatedMax: number; truncatedArithmetic: number; truncatedGeometric: number; truncatedHarmonic: number; }; /** * Checks if value is a string representing an N-byte hexadecimal number. * * @param {unknown} value - String to check. Be sure to trim whitespace, hex '0x' prefix, and bigint 'n' suffix. * @param {(number|null)} byteLength - Number of bytes the string should represent, or 'null' for any number greater than zero. * @returns True if value is a 2N-character hexadecimal string, else false. */ export declare function isHexN(value: unknown, byteLength: number | null): value is string; /** * Checks if value is a string representing an 8-byte hexadecimal number. * * @param {unknown} value - Value to check. * @returns True if value is a 16-character hexadecimal string, else false. */ export declare function isHex8(value: unknown): value is string; /** * Checks if value is a string representing a 32-byte hexadecimal number. * * @param {unknown} value - Value to check. * @returns True if value is a 64-character hex string, else false. */ export declare function isHex32(value: unknown): value is string; /** * Computes various types of averages for a set of numbers. * * @param {number[]} times - List of numbers, often timing durations. * @returns Object with averaged values for the specified list. */ export declare function stats(times: number[]): Averages | null;