@pezkuwi/util-crypto 14.0.5 → 14.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/address/encodeDerived.d.ts +1 -1
- package/address/encodeMulti.d.ts +1 -1
- package/address/eq.d.ts +1 -1
- package/address/keyDerived.d.ts +1 -1
- package/address/keyMulti.d.ts +1 -1
- package/base32/bs32.d.ts +1 -1
- package/base32/helpers.d.ts +2 -2
- package/base58/bs58.d.ts +1 -1
- package/base64/bs64.d.ts +1 -1
- package/blake2/asU8a.d.ts +2 -2
- package/{bundle-polkadot-util-crypto.js → bundle-pezkuwi-util-crypto.js} +6 -6
- package/bundleInit.d.ts +1 -1
- package/cjs/address/encodeDerived.d.ts +1 -1
- package/cjs/address/encodeMulti.d.ts +1 -1
- package/cjs/address/eq.d.ts +1 -1
- package/cjs/address/keyDerived.d.ts +1 -1
- package/cjs/address/keyMulti.d.ts +1 -1
- package/cjs/base32/bs32.d.ts +1 -1
- package/cjs/base32/helpers.d.ts +2 -2
- package/cjs/base58/bs58.d.ts +1 -1
- package/cjs/base64/bs64.d.ts +1 -1
- package/cjs/blake2/asU8a.d.ts +2 -2
- package/cjs/bundleInit.d.ts +1 -1
- package/cjs/crypto.d.ts +1 -1
- package/cjs/ed25519/pair/fromRandom.d.ts +1 -1
- package/cjs/ed25519/pair/fromSecret.d.ts +1 -1
- package/cjs/ed25519/pair/fromSeed.d.ts +1 -1
- package/cjs/ed25519/pair/fromString.d.ts +1 -1
- package/cjs/ed25519/sign.d.ts +1 -1
- package/cjs/ed25519/verify.d.ts +1 -1
- package/cjs/ethereum/encode.d.ts +1 -1
- package/cjs/helpers.d.ts +2 -2
- package/cjs/keccak/asU8a.d.ts +2 -2
- package/cjs/key/DeriveJunction.d.ts +1 -1
- package/cjs/mnemonic/generate.d.ts +1 -1
- package/cjs/mnemonic/toLegacySeed.d.ts +1 -1
- package/cjs/mnemonic/validate.d.ts +1 -1
- package/cjs/nacl/decrypt.d.ts +1 -1
- package/cjs/nacl/encrypt.d.ts +1 -1
- package/cjs/networks.d.ts +1 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/random/asNumber.d.ts +1 -1
- package/cjs/random/asU8a.d.ts +2 -2
- package/cjs/xxhash/asU8a.d.ts +2 -2
- package/crypto.d.ts +1 -1
- package/ed25519/pair/fromRandom.d.ts +1 -1
- package/ed25519/pair/fromSecret.d.ts +1 -1
- package/ed25519/pair/fromSeed.d.ts +1 -1
- package/ed25519/pair/fromString.d.ts +1 -1
- package/ed25519/sign.d.ts +1 -1
- package/ed25519/verify.d.ts +1 -1
- package/ethereum/encode.d.ts +1 -1
- package/helpers.d.ts +2 -2
- package/keccak/asU8a.d.ts +2 -2
- package/key/DeriveJunction.d.ts +1 -1
- package/mnemonic/generate.d.ts +1 -1
- package/mnemonic/toLegacySeed.d.ts +1 -1
- package/mnemonic/validate.d.ts +1 -1
- package/nacl/decrypt.d.ts +1 -1
- package/nacl/encrypt.d.ts +1 -1
- package/networks.d.ts +1 -1
- package/package.json +12 -12
- package/packageInfo.js +1 -1
- package/random/asNumber.d.ts +1 -1
- package/random/asU8a.d.ts +2 -2
- package/xxhash/asU8a.d.ts +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @pezkuwi/util-crypto
|
|
2
2
|
|
|
3
|
-
Various useful cyrpto utility functions that are used across all projects in the [@
|
|
3
|
+
Various useful cyrpto utility functions that are used across all projects in the [@pezkuwi](https://pezkuwi.js.org) namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
Installation -
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
yarn add @
|
|
10
|
+
yarn add @pezkuwi/util-crypto
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Functions can be imported as follows:
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
|
-
import { mnemonicGenerate } from '@
|
|
16
|
+
import { mnemonicGenerate } from '@pezkuwi/util-crypto';
|
|
17
17
|
```
|
package/address/encodeMulti.d.ts
CHANGED
package/address/eq.d.ts
CHANGED
package/address/keyDerived.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BN } from '@
|
|
1
|
+
import type { BN } from '@pezkuwi/util';
|
|
2
2
|
export declare function createKeyDerived(who: string | Uint8Array, index: bigint | BN | number): Uint8Array;
|
package/address/keyMulti.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BN } from '@
|
|
1
|
+
import type { BN } from '@pezkuwi/util';
|
|
2
2
|
export declare function createKeyMulti(who: (string | Uint8Array)[], threshold: bigint | BN | number): Uint8Array;
|
package/base32/bs32.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const base32Decode: (value: string, ipfsCompat?: boolean) => Uint
|
|
|
23
23
|
* @description
|
|
24
24
|
* From the provided input, create the base32 and return the result as a string.
|
|
25
25
|
*/
|
|
26
|
-
export declare const base32Encode: (value: import("@
|
|
26
|
+
export declare const base32Encode: (value: import("@pezkuwi/util/types").U8aLike, ipfsCompat?: boolean) => string;
|
package/base32/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { U8aLike } from '@
|
|
2
|
-
export type { U8aLike } from '@
|
|
1
|
+
import type { U8aLike } from '@pezkuwi/util/types';
|
|
2
|
+
export type { U8aLike } from '@pezkuwi/util/types';
|
|
3
3
|
interface Coder {
|
|
4
4
|
decode: (value: string) => Uint8Array;
|
|
5
5
|
encode: (value: Uint8Array) => string;
|
package/base58/bs58.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const base58Decode: (value: string, ipfsCompat?: boolean) => Uint
|
|
|
18
18
|
* @description
|
|
19
19
|
* From the provided input, create the base58 and return the result as a string.
|
|
20
20
|
*/
|
|
21
|
-
export declare const base58Encode: (value: import("@
|
|
21
|
+
export declare const base58Encode: (value: import("@pezkuwi/util/types").U8aLike, ipfsCompat?: boolean) => string;
|
|
22
22
|
/**
|
|
23
23
|
* @name isBase58
|
|
24
24
|
* @description Checks if the input is in base58, returning true/false
|
package/base64/bs64.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const base64Decode: (value: string, ipfsCompat?: boolean) => Uint
|
|
|
23
23
|
* @description
|
|
24
24
|
* From the provided input, create the base64 and return the result as a string.
|
|
25
25
|
*/
|
|
26
|
-
export declare const base64Encode: (value: import("@
|
|
26
|
+
export declare const base64Encode: (value: import("@pezkuwi/util/types").U8aLike, ipfsCompat?: boolean) => string;
|
package/blake2/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { blake2AsU8a } from '@
|
|
10
|
+
* import { blake2AsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* blake2AsU8a('abc'); // => [0xba, 0x80, 0xa5, 0x3f, 0x98, 0x1c, 0x4d, 0x0d]
|
|
13
13
|
* ```
|
|
@@ -17,4 +17,4 @@ export declare function blake2AsU8a(data: string | Uint8Array, bitLength?: 64 |
|
|
|
17
17
|
* @name blake2AsHex
|
|
18
18
|
* @description Creates a blake2b hex from the input.
|
|
19
19
|
*/
|
|
20
|
-
export declare const blake2AsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | undefined, key?: Uint8Array | null | undefined, onlyJs?: boolean | undefined) => import("@
|
|
20
|
+
export declare const blake2AsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | undefined, key?: Uint8Array | null | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@pezkuwi/util')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@pezkuwi/util'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.pezkuwiUtilCrypto = {}, global.pezkuwiUtil));
|
|
5
5
|
})(this, (function (exports, util) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : window;
|
|
8
8
|
|
|
9
9
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
|
-
const packageInfo$2 = { name: '@pezkuwi/x-global', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-
|
|
10
|
+
const packageInfo$2 = { name: '@pezkuwi/x-global', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href)) }) && (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href))) ? new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href))).pathname.substring(0, new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href))).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.6' };
|
|
11
11
|
|
|
12
12
|
function evaluateThis(fn) {
|
|
13
13
|
return fn('return this');
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
Object.defineProperty(packageInfo$1, "__esModule", { value: true });
|
|
86
86
|
packageInfo$1.packageInfo = void 0;
|
|
87
|
-
packageInfo$1.packageInfo = { name: '@pezkuwi/x-randomvalues', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.
|
|
87
|
+
packageInfo$1.packageInfo = { name: '@pezkuwi/x-randomvalues', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.6' };
|
|
88
88
|
|
|
89
89
|
(function (exports) {
|
|
90
90
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
cryptoWaitReady().catch(() => {
|
|
688
688
|
});
|
|
689
689
|
|
|
690
|
-
const packageInfo = { name: '@pezkuwi/util-crypto', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-
|
|
690
|
+
const packageInfo = { name: '@pezkuwi/util-crypto', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href)) }) && (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href))) ? new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href))).pathname.substring(0, new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('bundle-pezkuwi-util-crypto.js', document.baseURI).href))).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.6' };
|
|
691
691
|
|
|
692
692
|
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
693
693
|
function assertNumber(n) {
|
|
@@ -1578,7 +1578,7 @@
|
|
|
1578
1578
|
return [isValid, length, ss58Length, ss58Decoded];
|
|
1579
1579
|
}
|
|
1580
1580
|
|
|
1581
|
-
const
|
|
1581
|
+
const knownBizinikiwi = [
|
|
1582
1582
|
{
|
|
1583
1583
|
"prefix": 0,
|
|
1584
1584
|
"network": "polkadot",
|
|
@@ -3790,7 +3790,7 @@
|
|
|
3790
3790
|
? -1
|
|
3791
3791
|
: 1;
|
|
3792
3792
|
}
|
|
3793
|
-
const allNetworks =
|
|
3793
|
+
const allNetworks = knownBizinikiwi.map(toExpanded);
|
|
3794
3794
|
const availableNetworks = allNetworks.filter(filterAvailable).sort(sortNetworks);
|
|
3795
3795
|
const selectableNetworks = availableNetworks.filter(filterSelectable);
|
|
3796
3796
|
|
package/bundleInit.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@
|
|
1
|
+
import '@pezkuwi/x-bigint/shim';
|
package/cjs/address/eq.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BN } from '@
|
|
1
|
+
import type { BN } from '@pezkuwi/util';
|
|
2
2
|
export declare function createKeyDerived(who: string | Uint8Array, index: bigint | BN | number): Uint8Array;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BN } from '@
|
|
1
|
+
import type { BN } from '@pezkuwi/util';
|
|
2
2
|
export declare function createKeyMulti(who: (string | Uint8Array)[], threshold: bigint | BN | number): Uint8Array;
|
package/cjs/base32/bs32.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const base32Decode: (value: string, ipfsCompat?: boolean) => Uint
|
|
|
23
23
|
* @description
|
|
24
24
|
* From the provided input, create the base32 and return the result as a string.
|
|
25
25
|
*/
|
|
26
|
-
export declare const base32Encode: (value: import("@
|
|
26
|
+
export declare const base32Encode: (value: import("@pezkuwi/util/types").U8aLike, ipfsCompat?: boolean) => string;
|
package/cjs/base32/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { U8aLike } from '@
|
|
2
|
-
export type { U8aLike } from '@
|
|
1
|
+
import type { U8aLike } from '@pezkuwi/util/types';
|
|
2
|
+
export type { U8aLike } from '@pezkuwi/util/types';
|
|
3
3
|
interface Coder {
|
|
4
4
|
decode: (value: string) => Uint8Array;
|
|
5
5
|
encode: (value: Uint8Array) => string;
|
package/cjs/base58/bs58.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const base58Decode: (value: string, ipfsCompat?: boolean) => Uint
|
|
|
18
18
|
* @description
|
|
19
19
|
* From the provided input, create the base58 and return the result as a string.
|
|
20
20
|
*/
|
|
21
|
-
export declare const base58Encode: (value: import("@
|
|
21
|
+
export declare const base58Encode: (value: import("@pezkuwi/util/types").U8aLike, ipfsCompat?: boolean) => string;
|
|
22
22
|
/**
|
|
23
23
|
* @name isBase58
|
|
24
24
|
* @description Checks if the input is in base58, returning true/false
|
package/cjs/base64/bs64.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const base64Decode: (value: string, ipfsCompat?: boolean) => Uint
|
|
|
23
23
|
* @description
|
|
24
24
|
* From the provided input, create the base64 and return the result as a string.
|
|
25
25
|
*/
|
|
26
|
-
export declare const base64Encode: (value: import("@
|
|
26
|
+
export declare const base64Encode: (value: import("@pezkuwi/util/types").U8aLike, ipfsCompat?: boolean) => string;
|
package/cjs/blake2/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { blake2AsU8a } from '@
|
|
10
|
+
* import { blake2AsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* blake2AsU8a('abc'); // => [0xba, 0x80, 0xa5, 0x3f, 0x98, 0x1c, 0x4d, 0x0d]
|
|
13
13
|
* ```
|
|
@@ -17,4 +17,4 @@ export declare function blake2AsU8a(data: string | Uint8Array, bitLength?: 64 |
|
|
|
17
17
|
* @name blake2AsHex
|
|
18
18
|
* @description Creates a blake2b hex from the input.
|
|
19
19
|
*/
|
|
20
|
-
export declare const blake2AsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | undefined, key?: Uint8Array | null | undefined, onlyJs?: boolean | undefined) => import("@
|
|
20
|
+
export declare const blake2AsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | undefined, key?: Uint8Array | null | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|
package/cjs/bundleInit.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@
|
|
1
|
+
import '@pezkuwi/x-bigint/shim';
|
package/cjs/crypto.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromRandom } from '@
|
|
11
|
+
* import { ed25519PairFromRandom } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromRandom(); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromSecret } from '@
|
|
11
|
+
* import { ed25519PairFromSecret } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromSecret(...); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromSeed } from '@
|
|
11
|
+
* import { ed25519PairFromSeed } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromSeed(...); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromString } from '@
|
|
11
|
+
* import { ed25519PairFromString } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromString('test'); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
package/cjs/ed25519/sign.d.ts
CHANGED
package/cjs/ed25519/verify.d.ts
CHANGED
package/cjs/ethereum/encode.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { HexString } from '@
|
|
1
|
+
import type { HexString } from '@pezkuwi/util/types';
|
|
2
2
|
export declare function ethereumEncode(addressOrPublic?: string | Uint8Array): HexString;
|
package/cjs/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HexString } from '@
|
|
2
|
-
export type { HexString } from '@
|
|
1
|
+
import type { HexString } from '@pezkuwi/util/types';
|
|
2
|
+
export type { HexString } from '@pezkuwi/util/types';
|
|
3
3
|
interface DualHash {
|
|
4
4
|
256: (u8a: Uint8Array) => Uint8Array;
|
|
5
5
|
512: (u8a: Uint8Array) => Uint8Array;
|
package/cjs/keccak/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { keccakAsU8a } from '@
|
|
10
|
+
* import { keccakAsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* keccakAsU8a('123'); // => Uint8Array
|
|
13
13
|
* ```
|
|
@@ -27,4 +27,4 @@ export declare const keccak512AsU8a: (data: string | Uint8Array, onlyJs?: boolea
|
|
|
27
27
|
* @name keccakAsHex
|
|
28
28
|
* @description Creates a keccak hex string from the input.
|
|
29
29
|
*/
|
|
30
|
-
export declare const keccakAsHex: (value: string | Uint8Array, bitLength?: 256 | 512 | undefined, onlyJs?: boolean | undefined) => import("@
|
|
30
|
+
export declare const keccakAsHex: (value: string | Uint8Array, bitLength?: 256 | 512 | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* <BR>
|
|
6
6
|
*
|
|
7
7
|
* ```javascript
|
|
8
|
-
* import { mnemonicGenerate, mnemonicToLegacySeed, mnemonicValidate } from '@
|
|
8
|
+
* import { mnemonicGenerate, mnemonicToLegacySeed, mnemonicValidate } from '@pezkuwi/util-crypto';
|
|
9
9
|
*
|
|
10
10
|
* const mnemonic = mnemonicGenerate(); // => string
|
|
11
11
|
* const isValidMnemonic = mnemonicValidate(mnemonic); // => boolean
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* <BR>
|
|
6
6
|
*
|
|
7
7
|
* ```javascript
|
|
8
|
-
* import { mnemonicGenerate, mnemonicValidate } from '@
|
|
8
|
+
* import { mnemonicGenerate, mnemonicValidate } from '@pezkuwi/util-crypto';
|
|
9
9
|
*
|
|
10
10
|
* const mnemonic = mnemonicGenerate(); // => string
|
|
11
11
|
* const isValidMnemonic = mnemonicValidate(mnemonic); // => boolean
|
package/cjs/nacl/decrypt.d.ts
CHANGED
package/cjs/nacl/encrypt.d.ts
CHANGED
package/cjs/networks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { allNetworks, availableNetworks, selectableNetworks } from '@
|
|
1
|
+
export { allNetworks, availableNetworks, selectableNetworks } from '@pezkuwi/networks';
|
package/cjs/packageInfo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.packageInfo = void 0;
|
|
4
|
-
exports.packageInfo = { name: '@pezkuwi/util-crypto', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.
|
|
4
|
+
exports.packageInfo = { name: '@pezkuwi/util-crypto', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.6' };
|
package/cjs/random/asNumber.d.ts
CHANGED
package/cjs/random/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { randomAsU8a } from '@
|
|
10
|
+
* import { randomAsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* randomAsU8a(); // => Uint8Array([...])
|
|
13
13
|
* ```
|
|
@@ -17,4 +17,4 @@ export declare function randomAsU8a(length?: number): Uint8Array;
|
|
|
17
17
|
* @name randomAsHex
|
|
18
18
|
* @description Creates a hex string filled with random bytes.
|
|
19
19
|
*/
|
|
20
|
-
export declare const randomAsHex: (length?: number | undefined) => import("@
|
|
20
|
+
export declare const randomAsHex: (length?: number | undefined) => import("@pezkuwi/util/types").HexString;
|
package/cjs/xxhash/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { xxhashAsU8a } from '@
|
|
10
|
+
* import { xxhashAsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* xxhashAsU8a('abc'); // => 0x44bc2cf5ad770999
|
|
13
13
|
* ```
|
|
@@ -17,4 +17,4 @@ export declare function xxhashAsU8a(data: string | Uint8Array, bitLength?: 64 |
|
|
|
17
17
|
* @name xxhashAsHex
|
|
18
18
|
* @description Creates a xxhash64 hex from the input.
|
|
19
19
|
*/
|
|
20
|
-
export declare const xxhashAsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | 320 | 192 | 448 | undefined, onlyJs?: boolean | undefined) => import("@
|
|
20
|
+
export declare const xxhashAsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | 320 | 192 | 448 | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|
package/crypto.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromRandom } from '@
|
|
11
|
+
* import { ed25519PairFromRandom } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromRandom(); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromSecret } from '@
|
|
11
|
+
* import { ed25519PairFromSecret } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromSecret(...); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromSeed } from '@
|
|
11
|
+
* import { ed25519PairFromSeed } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromSeed(...); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
|
@@ -8,7 +8,7 @@ import type { Keypair } from '../../types.js';
|
|
|
8
8
|
* <BR>
|
|
9
9
|
*
|
|
10
10
|
* ```javascript
|
|
11
|
-
* import { ed25519PairFromString } from '@
|
|
11
|
+
* import { ed25519PairFromString } from '@pezkuwi/util-crypto';
|
|
12
12
|
*
|
|
13
13
|
* ed25519PairFromString('test'); // => { secretKey: [...], publicKey: [...] }
|
|
14
14
|
* ```
|
package/ed25519/sign.d.ts
CHANGED
package/ed25519/verify.d.ts
CHANGED
package/ethereum/encode.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { HexString } from '@
|
|
1
|
+
import type { HexString } from '@pezkuwi/util/types';
|
|
2
2
|
export declare function ethereumEncode(addressOrPublic?: string | Uint8Array): HexString;
|
package/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HexString } from '@
|
|
2
|
-
export type { HexString } from '@
|
|
1
|
+
import type { HexString } from '@pezkuwi/util/types';
|
|
2
|
+
export type { HexString } from '@pezkuwi/util/types';
|
|
3
3
|
interface DualHash {
|
|
4
4
|
256: (u8a: Uint8Array) => Uint8Array;
|
|
5
5
|
512: (u8a: Uint8Array) => Uint8Array;
|
package/keccak/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { keccakAsU8a } from '@
|
|
10
|
+
* import { keccakAsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* keccakAsU8a('123'); // => Uint8Array
|
|
13
13
|
* ```
|
|
@@ -27,4 +27,4 @@ export declare const keccak512AsU8a: (data: string | Uint8Array, onlyJs?: boolea
|
|
|
27
27
|
* @name keccakAsHex
|
|
28
28
|
* @description Creates a keccak hex string from the input.
|
|
29
29
|
*/
|
|
30
|
-
export declare const keccakAsHex: (value: string | Uint8Array, bitLength?: 256 | 512 | undefined, onlyJs?: boolean | undefined) => import("@
|
|
30
|
+
export declare const keccakAsHex: (value: string | Uint8Array, bitLength?: 256 | 512 | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|
package/key/DeriveJunction.d.ts
CHANGED
package/mnemonic/generate.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* <BR>
|
|
6
6
|
*
|
|
7
7
|
* ```javascript
|
|
8
|
-
* import { mnemonicGenerate, mnemonicToLegacySeed, mnemonicValidate } from '@
|
|
8
|
+
* import { mnemonicGenerate, mnemonicToLegacySeed, mnemonicValidate } from '@pezkuwi/util-crypto';
|
|
9
9
|
*
|
|
10
10
|
* const mnemonic = mnemonicGenerate(); // => string
|
|
11
11
|
* const isValidMnemonic = mnemonicValidate(mnemonic); // => boolean
|
package/mnemonic/validate.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* <BR>
|
|
6
6
|
*
|
|
7
7
|
* ```javascript
|
|
8
|
-
* import { mnemonicGenerate, mnemonicValidate } from '@
|
|
8
|
+
* import { mnemonicGenerate, mnemonicValidate } from '@pezkuwi/util-crypto';
|
|
9
9
|
*
|
|
10
10
|
* const mnemonic = mnemonicGenerate(); // => string
|
|
11
11
|
* const isValidMnemonic = mnemonicValidate(mnemonic); // => boolean
|
package/nacl/decrypt.d.ts
CHANGED
package/nacl/encrypt.d.ts
CHANGED
package/networks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { allNetworks, availableNetworks, selectableNetworks } from '@
|
|
1
|
+
export { allNetworks, availableNetworks, selectableNetworks } from '@pezkuwi/networks';
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Jaco Greeff <jacogr@gmail.com>",
|
|
3
|
-
"bugs": "https://github.com/
|
|
4
|
-
"description": "A collection of useful crypto utilities for @
|
|
3
|
+
"bugs": "https://github.com/pezkuwichain/pezkuwi-common/issues",
|
|
4
|
+
"description": "A collection of useful crypto utilities for @pezkuwi",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
7
7
|
},
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/pezkuwichain/pezkuwi-common/tree/master/packages/util-crypto#readme",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"name": "@pezkuwi/util-crypto",
|
|
11
11
|
"repository": {
|
|
12
12
|
"directory": "packages/util-crypto",
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/pezkuwichain/pezkuwi-common.git"
|
|
15
15
|
},
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"./bundleInit.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./cjs/packageDetect.js"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "14.0.
|
|
23
|
+
"version": "14.0.7",
|
|
24
24
|
"main": "./cjs/index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
26
|
"browser": {
|
|
@@ -2041,17 +2041,17 @@
|
|
|
2041
2041
|
"dependencies": {
|
|
2042
2042
|
"@noble/curves": "^1.3.0",
|
|
2043
2043
|
"@noble/hashes": "^1.3.3",
|
|
2044
|
-
"@pezkuwi/networks": "14.0.
|
|
2045
|
-
"@pezkuwi/util": "14.0.
|
|
2046
|
-
"@pezkuwi/wasm-crypto": "^7.5.
|
|
2047
|
-
"@pezkuwi/wasm-util": "^7.5.
|
|
2048
|
-
"@pezkuwi/x-bigint": "14.0.
|
|
2049
|
-
"@pezkuwi/x-randomvalues": "14.0.
|
|
2044
|
+
"@pezkuwi/networks": "14.0.1",
|
|
2045
|
+
"@pezkuwi/util": "14.0.1",
|
|
2046
|
+
"@pezkuwi/wasm-crypto": "^7.5.4",
|
|
2047
|
+
"@pezkuwi/wasm-util": "^7.5.4",
|
|
2048
|
+
"@pezkuwi/x-bigint": "14.0.1",
|
|
2049
|
+
"@pezkuwi/x-randomvalues": "14.0.1",
|
|
2050
2050
|
"@scure/base": "^1.1.7",
|
|
2051
2051
|
"@scure/sr25519": "^0.2.0",
|
|
2052
2052
|
"tslib": "^2.8.0"
|
|
2053
2053
|
},
|
|
2054
2054
|
"peerDependencies": {
|
|
2055
|
-
"@pezkuwi/util": "14.0.
|
|
2055
|
+
"@pezkuwi/util": "14.0.1"
|
|
2056
2056
|
}
|
|
2057
2057
|
}
|
package/packageInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageInfo = { name: '@pezkuwi/util-crypto', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.
|
|
1
|
+
export const packageInfo = { name: '@pezkuwi/util-crypto', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.6' };
|
package/random/asNumber.d.ts
CHANGED
package/random/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { randomAsU8a } from '@
|
|
10
|
+
* import { randomAsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* randomAsU8a(); // => Uint8Array([...])
|
|
13
13
|
* ```
|
|
@@ -17,4 +17,4 @@ export declare function randomAsU8a(length?: number): Uint8Array;
|
|
|
17
17
|
* @name randomAsHex
|
|
18
18
|
* @description Creates a hex string filled with random bytes.
|
|
19
19
|
*/
|
|
20
|
-
export declare const randomAsHex: (length?: number | undefined) => import("@
|
|
20
|
+
export declare const randomAsHex: (length?: number | undefined) => import("@pezkuwi/util/types").HexString;
|
package/xxhash/asU8a.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* <BR>
|
|
8
8
|
*
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import { xxhashAsU8a } from '@
|
|
10
|
+
* import { xxhashAsU8a } from '@pezkuwi/util-crypto';
|
|
11
11
|
*
|
|
12
12
|
* xxhashAsU8a('abc'); // => 0x44bc2cf5ad770999
|
|
13
13
|
* ```
|
|
@@ -17,4 +17,4 @@ export declare function xxhashAsU8a(data: string | Uint8Array, bitLength?: 64 |
|
|
|
17
17
|
* @name xxhashAsHex
|
|
18
18
|
* @description Creates a xxhash64 hex from the input.
|
|
19
19
|
*/
|
|
20
|
-
export declare const xxhashAsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | 320 | 192 | 448 | undefined, onlyJs?: boolean | undefined) => import("@
|
|
20
|
+
export declare const xxhashAsHex: (data: string | Uint8Array, bitLength?: 256 | 512 | 64 | 128 | 384 | 320 | 192 | 448 | undefined, onlyJs?: boolean | undefined) => import("@pezkuwi/util/types").HexString;
|