mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-06-19 19:21:04 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @name keccakAsU8a
|
||||
* @summary Creates a keccak Uint8Array from the input.
|
||||
* @description
|
||||
* From either a `string` or a `Buffer` input, create the keccak and return the result as a `Uint8Array`.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* import { keccakAsU8a } from '@pezkuwi/util-crypto';
|
||||
*
|
||||
* keccakAsU8a('123'); // => Uint8Array
|
||||
* ```
|
||||
*/
|
||||
export declare const keccakAsU8a: (value: string | Uint8Array, bitLength?: 256 | 512, onlyJs?: boolean) => Uint8Array;
|
||||
/**
|
||||
* @name keccak256AsU8a
|
||||
* @description Creates a keccak256 Uint8Array from the input.
|
||||
*/
|
||||
export declare const keccak256AsU8a: (data: string | Uint8Array, onlyJs?: boolean) => Uint8Array;
|
||||
/**
|
||||
* @name keccak512AsU8a
|
||||
* @description Creates a keccak512 Uint8Array from the input.
|
||||
*/
|
||||
export declare const keccak512AsU8a: (data: string | Uint8Array, onlyJs?: boolean) => Uint8Array;
|
||||
/**
|
||||
* @name keccakAsHex
|
||||
* @description Creates a keccak hex string from the input.
|
||||
*/
|
||||
export declare const keccakAsHex: (value: string | Uint8Array, bitLength?: 256 | 512 | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|
||||
@@ -0,0 +1,33 @@
|
||||
import { keccak_256 as keccak256Js, keccak_512 as keccak512Js } from '@noble/hashes/sha3';
|
||||
import { keccak256, keccak512 } from '@pezkuwi/wasm-crypto';
|
||||
import { createAsHex, createBitHasher, createDualHasher } from '../helpers.js';
|
||||
/**
|
||||
* @name keccakAsU8a
|
||||
* @summary Creates a keccak Uint8Array from the input.
|
||||
* @description
|
||||
* From either a `string` or a `Buffer` input, create the keccak and return the result as a `Uint8Array`.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* import { keccakAsU8a } from '@pezkuwi/util-crypto';
|
||||
*
|
||||
* keccakAsU8a('123'); // => Uint8Array
|
||||
* ```
|
||||
*/
|
||||
export const keccakAsU8a = /*#__PURE__*/ createDualHasher({ 256: keccak256, 512: keccak512 }, { 256: keccak256Js, 512: keccak512Js });
|
||||
/**
|
||||
* @name keccak256AsU8a
|
||||
* @description Creates a keccak256 Uint8Array from the input.
|
||||
*/
|
||||
export const keccak256AsU8a = /*#__PURE__*/ createBitHasher(256, keccakAsU8a);
|
||||
/**
|
||||
* @name keccak512AsU8a
|
||||
* @description Creates a keccak512 Uint8Array from the input.
|
||||
*/
|
||||
export const keccak512AsU8a = /*#__PURE__*/ createBitHasher(512, keccakAsU8a);
|
||||
/**
|
||||
* @name keccakAsHex
|
||||
* @description Creates a keccak hex string from the input.
|
||||
*/
|
||||
export const keccakAsHex = /*#__PURE__*/ createAsHex(keccakAsU8a);
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @summary Create Keccak256/512 values as hex & Uint8Array output
|
||||
*/
|
||||
export { keccak256AsU8a, keccak512AsU8a, keccakAsHex, keccakAsU8a } from './asU8a.js';
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @summary Create Keccak256/512 values as hex & Uint8Array output
|
||||
*/
|
||||
export { keccak256AsU8a, keccak512AsU8a, keccakAsHex, keccakAsU8a } from './asU8a.js';
|
||||
Reference in New Issue
Block a user