-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
6 changed files
with
111 additions
and
94 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,97 @@ | ||
/** | ||
*/ | ||
declare class Hash { | ||
free(): void | ||
/** | ||
* @returns {string} | ||
*/ | ||
toString(): string | ||
/** | ||
* @returns {string} | ||
*/ | ||
toHex(): string | ||
/** | ||
* @returns {string} | ||
*/ | ||
toBinary(): string | ||
/** | ||
* @returns {string} | ||
*/ | ||
toOctal(): string | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
toBytes(): Uint8Array | ||
/** | ||
* @returns {Uint32Array} | ||
*/ | ||
toUint32Array(): Uint32Array | ||
/** | ||
* @returns {BigUint64Array} | ||
*/ | ||
toUint64Array(): BigUint64Array | ||
free(): void; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toString(): string; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toHex(): string; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toBinary(): string; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toOctal(): string; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
toBytes(): Uint8Array; | ||
/** | ||
* @returns {Uint32Array} | ||
*/ | ||
toUint32Array(): Uint32Array; | ||
/** | ||
* @returns {BigUint64Array} | ||
*/ | ||
toUint64Array(): BigUint64Array; | ||
} | ||
|
||
declare interface HighwayOptions { | ||
key?: Uint8Array | ||
simd?: boolean | ||
key?: Uint8Array | ||
simd?: boolean | ||
} | ||
|
||
export declare const useHighway: ( | ||
options?: HighwayOptions | undefined | ||
options?: HighwayOptions | undefined | ||
) => Promise<{ | ||
hasher: typeof WasmHighway | ||
new: (key: Uint8Array) => WasmHighway | ||
hash64: (data: Uint8Array) => Hash | ||
hash128: (data: Uint8Array) => Hash | ||
hash256: (data: Uint8Array) => Hash | ||
}> | ||
hasher: typeof WasmHighway | ||
new: (key: Uint8Array) => WasmHighway | ||
hash64: (data: Uint8Array) => Hash | ||
hash128: (data: Uint8Array) => Hash | ||
hash256: (data: Uint8Array) => Hash | ||
}>; | ||
|
||
export declare const useSimd: () => boolean | ||
export declare const useSimd: () => boolean; | ||
|
||
/** | ||
*/ | ||
declare class WasmHighway { | ||
free(): void | ||
/** | ||
* @param {Uint8Array} key | ||
* @returns {WasmHighway} | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-misused-new | ||
static new(key: Uint8Array): WasmHighway | ||
/** | ||
* @param {Uint8Array} key | ||
* @param {Uint8Array} data | ||
* @returns {Hash} | ||
*/ | ||
static hash64(key: Uint8Array, data: Uint8Array): Hash | ||
/** | ||
* @param {Uint8Array} key | ||
* @param {Uint8Array} data | ||
* @returns {Hash} | ||
*/ | ||
static hash128(key: Uint8Array, data: Uint8Array): Hash | ||
/** | ||
* @param {Uint8Array} key | ||
* @param {Uint8Array} data | ||
* @returns {Hash} | ||
*/ | ||
static hash256(key: Uint8Array, data: Uint8Array): Hash | ||
/** | ||
* @param {Uint8Array} data | ||
*/ | ||
append(data: Uint8Array): void | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
finalize64(): Hash | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
finalize128(): Hash | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
finalize256(): Hash | ||
free(): void; | ||
/** | ||
* @param {Uint8Array} key | ||
* @returns {WasmHighway} | ||
*/ | ||
static new(key: Uint8Array): WasmHighway; | ||
/** | ||
* @param {Uint8Array} key | ||
* @param {Uint8Array} data | ||
* @returns {Hash} | ||
*/ | ||
static hash64(key: Uint8Array, data: Uint8Array): Hash; | ||
/** | ||
* @param {Uint8Array} key | ||
* @param {Uint8Array} data | ||
* @returns {Hash} | ||
*/ | ||
static hash128(key: Uint8Array, data: Uint8Array): Hash; | ||
/** | ||
* @param {Uint8Array} key | ||
* @param {Uint8Array} data | ||
* @returns {Hash} | ||
*/ | ||
static hash256(key: Uint8Array, data: Uint8Array): Hash; | ||
/** | ||
* @param {Uint8Array} data | ||
*/ | ||
append(data: Uint8Array): void; | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
finalize64(): Hash; | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
finalize128(): Hash; | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
finalize256(): Hash; | ||
} | ||
|
||
export {} | ||
export { } |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters