@dxos/crypto 2.33.8-dev.c77ba621 → 2.33.9-dev.2637427f
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/dist/src/encrypt.js +6 -6
- package/dist/src/encrypt.js.map +1 -1
- package/dist/src/hash.js +3 -3
- package/dist/src/hash.js.map +1 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/keys.d.ts +0 -15
- package/dist/src/keys.d.ts.map +1 -1
- package/dist/src/keys.js +10 -46
- package/dist/src/keys.js.map +1 -1
- package/dist/src/keys.test.js +1 -12
- package/dist/src/keys.test.js.map +1 -1
- package/dist/src/validator.d.ts.map +1 -1
- package/dist/src/validator.js +2 -2
- package/dist/src/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/src/encrypt.ts +1 -1
- package/src/hash.ts +1 -1
- package/src/index.ts +0 -2
- package/src/keys.test.ts +2 -18
- package/src/keys.ts +4 -49
- package/src/validator.ts +2 -2
- package/dist/src/human-hash.d.ts +0 -39
- package/dist/src/human-hash.d.ts.map +0 -1
- package/dist/src/human-hash.js +0 -114
- package/dist/src/human-hash.js.map +0 -1
- package/dist/src/seedphrase.d.ts +0 -9
- package/dist/src/seedphrase.d.ts.map +0 -1
- package/dist/src/seedphrase.js +0 -28
- package/dist/src/seedphrase.js.map +0 -1
- package/dist/src/seedphrase.test.d.ts +0 -2
- package/dist/src/seedphrase.test.d.ts.map +0 -1
- package/dist/src/seedphrase.test.js +0 -21
- package/dist/src/seedphrase.test.js.map +0 -1
- package/src/human-hash.ts +0 -119
- package/src/seedphrase.test.ts +0 -23
- package/src/seedphrase.ts +0 -24
package/dist/src/encrypt.js
CHANGED
|
@@ -7,8 +7,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.decrypt = exports.encrypt = void 0;
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
11
10
|
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
11
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
12
12
|
/**
|
|
13
13
|
* Encrypt string plaintext to a base64-encoded string ciphertext.
|
|
14
14
|
* @param plaintext
|
|
@@ -17,8 +17,8 @@ const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
|
17
17
|
* @returns ciphertext
|
|
18
18
|
*/
|
|
19
19
|
const encrypt = (plaintext, passphrase, cipher = 'AES') => {
|
|
20
|
-
(0,
|
|
21
|
-
(0,
|
|
20
|
+
(0, node_assert_1.default)(typeof passphrase === 'string');
|
|
21
|
+
(0, node_assert_1.default)(typeof cipher === 'string');
|
|
22
22
|
return crypto_js_1.default[cipher].encrypt(plaintext, passphrase).toString();
|
|
23
23
|
};
|
|
24
24
|
exports.encrypt = encrypt;
|
|
@@ -30,9 +30,9 @@ exports.encrypt = encrypt;
|
|
|
30
30
|
* @returns plaintext
|
|
31
31
|
*/
|
|
32
32
|
const decrypt = (ciphertext, passphrase, cipher = 'AES') => {
|
|
33
|
-
(0,
|
|
34
|
-
(0,
|
|
35
|
-
(0,
|
|
33
|
+
(0, node_assert_1.default)(typeof ciphertext === 'string');
|
|
34
|
+
(0, node_assert_1.default)(typeof passphrase === 'string');
|
|
35
|
+
(0, node_assert_1.default)(typeof cipher === 'string');
|
|
36
36
|
const bytes = crypto_js_1.default[cipher].decrypt(ciphertext, passphrase);
|
|
37
37
|
return bytes.toString(crypto_js_1.default.enc.Utf8);
|
|
38
38
|
};
|
package/dist/src/encrypt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encrypt.js","sourceRoot":"","sources":["../../src/encrypt.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,
|
|
1
|
+
{"version":3,"file":"encrypt.js","sourceRoot":"","sources":["../../src/encrypt.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,0DAAiC;AACjC,8DAAiC;AAEjC;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,UAAkB,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE;IAC/E,IAAA,qBAAM,EAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC;IACvC,IAAA,qBAAM,EAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC;IAEnC,OAAQ,mBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC7E,CAAC,CAAC;AALW,QAAA,OAAO,WAKlB;AAEF;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,CAAC,UAAkB,EAAE,UAAkB,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE;IAChF,IAAA,qBAAM,EAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC;IACvC,IAAA,qBAAM,EAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC;IACvC,IAAA,qBAAM,EAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC;IAEnC,MAAM,KAAK,GAAI,mBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACxE,OAAO,KAAK,CAAC,QAAQ,CAAC,mBAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC,CAAC;AAPW,QAAA,OAAO,WAOlB"}
|
package/dist/src/hash.js
CHANGED
|
@@ -7,16 +7,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ripemd160 = exports.sha512 = exports.sha256 = exports.sha1 = void 0;
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
11
10
|
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
11
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
* @param algorithm
|
|
15
15
|
* @param plaintext
|
|
16
16
|
*/
|
|
17
17
|
const _hash = (algorithm, plaintext) => {
|
|
18
|
-
(0,
|
|
19
|
-
(0,
|
|
18
|
+
(0, node_assert_1.default)(typeof algorithm === 'string');
|
|
19
|
+
(0, node_assert_1.default)(typeof plaintext === 'string');
|
|
20
20
|
return crypto_js_1.default[algorithm](plaintext).toString();
|
|
21
21
|
};
|
|
22
22
|
/**
|
package/dist/src/hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/hash.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/hash.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,0DAAiC;AACjC,8DAAiC;AAEjC;;;;GAIG;AACH,MAAM,KAAK,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAU,EAAE;IAC7D,IAAA,qBAAM,EAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC;IACtC,IAAA,qBAAM,EAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC;IAEtC,OAAQ,mBAAgB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC5D,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAA7C,QAAA,IAAI,QAAyC;AAE1D;;;GAGG;AACI,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAAjD,QAAA,MAAM,UAA2C;AAE9D;;;GAGG;AACI,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAAjD,QAAA,MAAM,UAA2C;AAE9D;;;GAGG;AACI,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAAvD,QAAA,SAAS,aAA8C"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -19,8 +19,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
__exportStar(require("./encrypt"), exports);
|
|
21
21
|
__exportStar(require("./hash"), exports);
|
|
22
|
-
__exportStar(require("./human-hash"), exports);
|
|
23
22
|
__exportStar(require("./keys"), exports);
|
|
24
|
-
__exportStar(require("./seedphrase"), exports);
|
|
25
23
|
__exportStar(require("./validator"), exports);
|
|
26
24
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,4CAA0B;AAC1B,yCAAuB;AACvB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,4CAA0B;AAC1B,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B"}
|
package/dist/src/keys.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { PublicKeyLike } from '@dxos/protocols';
|
|
3
|
-
import { HumanHasher } from './human-hash';
|
|
4
|
-
export declare const hasher: HumanHasher;
|
|
5
|
-
export declare const PUBLIC_KEY_LENGTH = 32;
|
|
6
|
-
export declare const SECRET_KEY_LENGTH = 64;
|
|
7
3
|
export declare const SIGNATURE_LENGTH = 64;
|
|
8
4
|
export declare const zeroKey: () => Uint8Array;
|
|
9
5
|
export interface KeyPair {
|
|
@@ -12,17 +8,6 @@ export interface KeyPair {
|
|
|
12
8
|
}
|
|
13
9
|
export declare const createKeyPair: (seed?: Buffer) => KeyPair;
|
|
14
10
|
export declare const discoveryKey: (key: PublicKeyLike) => Buffer;
|
|
15
|
-
/**
|
|
16
|
-
* @param {string} str - Hex string representation of key.
|
|
17
|
-
* @return {Buffer} Key buffer.
|
|
18
|
-
*/
|
|
19
|
-
export declare const keyToBuffer: (str: string) => Buffer;
|
|
20
|
-
/**
|
|
21
|
-
* @param {Buffer | Uint8Array} buffer - Key buffer.
|
|
22
|
-
* @return {string} Hex string representation of key.
|
|
23
|
-
*/
|
|
24
|
-
export declare const keyToString: (buffer: PublicKeyLike) => string;
|
|
25
|
-
export declare const humanize: (value: PublicKeyLike) => string;
|
|
26
11
|
/**
|
|
27
12
|
* Return random bytes of length.
|
|
28
13
|
* @param [length=32]
|
package/dist/src/keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/keys.ts"],"names":[],"mappings":";AAOA,OAAO,EAAa,aAAa,
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/keys.ts"],"names":[],"mappings":";AAOA,OAAO,EAAa,aAAa,EAAwC,MAAM,iBAAiB,CAAC;AAEjG,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,OAAO,kBAA2B,CAAC;AAEhD,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,OAM7C,CAAC;AAEF,eAAO,MAAM,YAAY,QAAS,aAAa,KAAG,MAA6D,CAAC;AAEhH;;;;GAIG;AACH,eAAO,MAAM,WAAW,uBAAkB,MAAoC,CAAC;AAE/E;;GAEG;AAEH,eAAO,MAAM,QAAQ,QAAO,MAA8C,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,IAAI,YAAa,MAAM,aAAa,MAAM,KAAG,MAKzD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,YAAa,MAAM,aAAa,MAAM,aAAa,MAAM,KAAG,OAM9E,CAAC"}
|
package/dist/src/keys.js
CHANGED
|
@@ -6,20 +6,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.verify = exports.sign = exports.createId = exports.randomBytes = exports.
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
9
|
+
exports.verify = exports.sign = exports.createId = exports.randomBytes = exports.discoveryKey = exports.createKeyPair = exports.zeroKey = exports.SIGNATURE_LENGTH = void 0;
|
|
11
10
|
const hypercore_crypto_1 = __importDefault(require("hypercore-crypto"));
|
|
11
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
12
12
|
const protocols_1 = require("@dxos/protocols");
|
|
13
|
-
const human_hash_1 = require("./human-hash");
|
|
14
|
-
exports.hasher = new human_hash_1.HumanHasher();
|
|
15
|
-
exports.PUBLIC_KEY_LENGTH = 32; // TODO(wittjosiah): Move to protocols with PublicKey?
|
|
16
|
-
exports.SECRET_KEY_LENGTH = 64;
|
|
17
13
|
exports.SIGNATURE_LENGTH = 64;
|
|
18
14
|
const zeroKey = () => new Uint8Array(32);
|
|
19
15
|
exports.zeroKey = zeroKey;
|
|
20
16
|
const createKeyPair = (seed) => {
|
|
21
17
|
if (seed) {
|
|
22
|
-
(0,
|
|
18
|
+
(0, node_assert_1.default)(seed.length >= 32, 'Seedphrase too sort. Expecting length of 32.');
|
|
23
19
|
return hypercore_crypto_1.default.keyPair(seed.slice(0, 32));
|
|
24
20
|
}
|
|
25
21
|
return hypercore_crypto_1.default.keyPair();
|
|
@@ -27,39 +23,6 @@ const createKeyPair = (seed) => {
|
|
|
27
23
|
exports.createKeyPair = createKeyPair;
|
|
28
24
|
const discoveryKey = (key) => hypercore_crypto_1.default.discoveryKey(protocols_1.PublicKey.from(key).asBuffer());
|
|
29
25
|
exports.discoveryKey = discoveryKey;
|
|
30
|
-
/**
|
|
31
|
-
* @param {string} str - Hex string representation of key.
|
|
32
|
-
* @return {Buffer} Key buffer.
|
|
33
|
-
*/
|
|
34
|
-
const keyToBuffer = (str) => {
|
|
35
|
-
(0, assert_1.default)(typeof str === 'string', 'Invalid type');
|
|
36
|
-
const buffer = Buffer.from(str, 'hex');
|
|
37
|
-
(0, assert_1.default)(buffer.length === exports.PUBLIC_KEY_LENGTH || buffer.length === exports.SECRET_KEY_LENGTH, `Invalid key length: ${buffer.length}`);
|
|
38
|
-
return buffer;
|
|
39
|
-
};
|
|
40
|
-
exports.keyToBuffer = keyToBuffer;
|
|
41
|
-
/**
|
|
42
|
-
* @param {Buffer | Uint8Array} buffer - Key buffer.
|
|
43
|
-
* @return {string} Hex string representation of key.
|
|
44
|
-
*/
|
|
45
|
-
const keyToString = (buffer) => {
|
|
46
|
-
if (buffer instanceof protocols_1.PublicKey) {
|
|
47
|
-
buffer = buffer.asBuffer();
|
|
48
|
-
}
|
|
49
|
-
else if (buffer instanceof Uint8Array) {
|
|
50
|
-
buffer = Buffer.from(buffer);
|
|
51
|
-
}
|
|
52
|
-
(0, assert_1.default)(buffer instanceof Buffer, 'Invalid type');
|
|
53
|
-
return buffer.toString('hex');
|
|
54
|
-
};
|
|
55
|
-
exports.keyToString = keyToString;
|
|
56
|
-
const humanize = (value) => {
|
|
57
|
-
if (value instanceof protocols_1.PublicKey || value instanceof Buffer || value instanceof Uint8Array) {
|
|
58
|
-
value = (0, exports.keyToString)(value);
|
|
59
|
-
}
|
|
60
|
-
return exports.hasher.humanize(value);
|
|
61
|
-
};
|
|
62
|
-
exports.humanize = humanize;
|
|
63
26
|
/**
|
|
64
27
|
* Return random bytes of length.
|
|
65
28
|
* @param [length=32]
|
|
@@ -70,7 +33,8 @@ exports.randomBytes = randomBytes;
|
|
|
70
33
|
/**
|
|
71
34
|
* @return {string}
|
|
72
35
|
*/
|
|
73
|
-
|
|
36
|
+
// TODO(wittjosiah): This probably shouldn't rely on PublicKey?
|
|
37
|
+
const createId = () => protocols_1.PublicKey.stringify((0, exports.randomBytes)(32));
|
|
74
38
|
exports.createId = createId;
|
|
75
39
|
/**
|
|
76
40
|
* Sign the contents of message with secretKey
|
|
@@ -79,8 +43,8 @@ exports.createId = createId;
|
|
|
79
43
|
* @returns {Buffer} signature
|
|
80
44
|
*/
|
|
81
45
|
const sign = (message, secretKey) => {
|
|
82
|
-
(0,
|
|
83
|
-
(0,
|
|
46
|
+
(0, node_assert_1.default)(Buffer.isBuffer(message));
|
|
47
|
+
(0, node_assert_1.default)(Buffer.isBuffer(secretKey) && secretKey.length === protocols_1.SECRET_KEY_LENGTH);
|
|
84
48
|
return hypercore_crypto_1.default.sign(message, secretKey);
|
|
85
49
|
};
|
|
86
50
|
exports.sign = sign;
|
|
@@ -92,9 +56,9 @@ exports.sign = sign;
|
|
|
92
56
|
* @return {boolean}
|
|
93
57
|
*/
|
|
94
58
|
const verify = (message, signature, publicKey) => {
|
|
95
|
-
(0,
|
|
96
|
-
(0,
|
|
97
|
-
(0,
|
|
59
|
+
(0, node_assert_1.default)(Buffer.isBuffer(message));
|
|
60
|
+
(0, node_assert_1.default)(Buffer.isBuffer(signature) && signature.length === exports.SIGNATURE_LENGTH);
|
|
61
|
+
(0, node_assert_1.default)(Buffer.isBuffer(publicKey) && publicKey.length === protocols_1.PUBLIC_KEY_LENGTH);
|
|
98
62
|
return hypercore_crypto_1.default.verify(message, signature, publicKey);
|
|
99
63
|
};
|
|
100
64
|
exports.verify = verify;
|
package/dist/src/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/keys.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/keys.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,wEAAsC;AACtC,8DAAiC;AAEjC,+CAAiG;AAEpF,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAE5B,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAAnC,QAAA,OAAO,WAA4B;AAOzC,MAAM,aAAa,GAAG,CAAC,IAAa,EAAW,EAAE;IACtD,IAAI,IAAI,EAAE;QACR,IAAA,qBAAM,EAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,8CAA8C,CAAC,CAAC;QAC1E,OAAO,0BAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;KAC1C;IACD,OAAO,0BAAM,CAAC,OAAO,EAAE,CAAC;AAC1B,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB;AAEK,MAAM,YAAY,GAAG,CAAC,GAAkB,EAAU,EAAE,CAAC,0BAAM,CAAC,YAAY,CAAC,qBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAAnG,QAAA,YAAY,gBAAuF;AAEhH;;;;GAIG;AACI,MAAM,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,EAAU,EAAE,CAAC,0BAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAAlE,QAAA,WAAW,eAAuD;AAE/E;;GAEG;AACH,+DAA+D;AACxD,MAAM,QAAQ,GAAG,GAAW,EAAE,CAAC,qBAAS,CAAC,SAAS,CAAC,IAAA,mBAAW,EAAC,EAAE,CAAC,CAAC,CAAC;AAA9D,QAAA,QAAQ,YAAsD;AAE3E;;;;;GAKG;AACI,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAU,EAAE;IACjE,IAAA,qBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,IAAA,qBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,6BAAiB,CAAC,CAAC;IAE7E,OAAO,0BAAM,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC,CAAC;AALW,QAAA,IAAI,QAKf;AAEF;;;;;;GAMG;AACI,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAE,SAAiB,EAAW,EAAE;IACvF,IAAA,qBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,IAAA,qBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,wBAAgB,CAAC,CAAC;IAC5E,IAAA,qBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,6BAAiB,CAAC,CAAC;IAE7E,OAAO,0BAAM,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,MAAM,UAMjB"}
|
package/dist/src/keys.test.js
CHANGED
|
@@ -5,18 +5,7 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// DXOS testing browser.
|
|
7
7
|
const keys_1 = require("./keys");
|
|
8
|
-
test('
|
|
9
|
-
const { publicKey } = (0, keys_1.createKeyPair)();
|
|
10
|
-
expect((0, keys_1.keyToBuffer)((0, keys_1.keyToString)(publicKey))).toEqual(publicKey);
|
|
11
|
-
expect(() => (0, keys_1.keyToString)('not-a-buffer')).toThrowError();
|
|
12
|
-
expect(() => (0, keys_1.keyToBuffer)('not-a-value-hex-key')).toThrowError();
|
|
13
|
-
expect(() => (0, keys_1.keyToBuffer)(publicKey)).toThrowError();
|
|
14
|
-
});
|
|
15
|
-
test('Hashing', () => {
|
|
16
|
-
const { publicKey, secretKey } = (0, keys_1.createKeyPair)();
|
|
8
|
+
test('Create id is unique', () => {
|
|
17
9
|
expect((0, keys_1.createId)()).not.toEqual((0, keys_1.createId)());
|
|
18
|
-
expect((0, keys_1.humanize)(publicKey)).not.toEqual((0, keys_1.humanize)(secretKey));
|
|
19
|
-
expect((0, keys_1.humanize)(publicKey)).toEqual(keys_1.hasher.humanize((0, keys_1.keyToString)(publicKey)));
|
|
20
|
-
expect(keys_1.hasher.humanize((0, keys_1.createId)())).toBeDefined();
|
|
21
10
|
});
|
|
22
11
|
//# sourceMappingURL=keys.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.test.js","sourceRoot":"","sources":["../../src/keys.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,wBAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"keys.test.js","sourceRoot":"","sources":["../../src/keys.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,wBAAwB;AAExB,iCAAkC;AAElC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAC/B,MAAM,CAAC,IAAA,eAAQ,GAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAA,eAAQ,GAAE,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/validator.ts"],"names":[],"mappings":";AAQA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,cACpB,MAAM,eAAe,MAAM,aAAa,MAAM,
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/validator.ts"],"names":[],"mappings":";AAQA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,cACpB,MAAM,eAAe,MAAM,aAAa,MAAM,QAA+D,CAAC"}
|
package/dist/src/validator.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getSignatureValidator = void 0;
|
|
7
7
|
const hypercore_crypto_1 = require("hypercore-crypto");
|
|
8
|
-
const
|
|
8
|
+
const protocols_1 = require("@dxos/protocols");
|
|
9
9
|
/**
|
|
10
10
|
* Generator for signature validation function.
|
|
11
11
|
* @param {String} publicKey
|
|
12
12
|
*/
|
|
13
|
-
const getSignatureValidator = (publicKey) => (message, signature) => (0, hypercore_crypto_1.verify)(message, signature,
|
|
13
|
+
const getSignatureValidator = (publicKey) => (message, signature) => (0, hypercore_crypto_1.verify)(message, signature, protocols_1.PublicKey.bufferize(publicKey));
|
|
14
14
|
exports.getSignatureValidator = getSignatureValidator;
|
|
15
15
|
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/validator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uDAA0C;AAE1C
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/validator.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,uDAA0C;AAE1C,+CAA4C;AAE5C;;;GAGG;AACI,MAAM,qBAAqB,GAChC,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,OAAe,EAAE,SAAiB,EAAE,EAAE,CAAC,IAAA,yBAAM,EAAC,OAAO,EAAE,SAAS,EAAE,qBAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AAD/G,QAAA,qBAAqB,yBAC0F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+crypto-js@4.0.2/node_modules/@types/crypto-js/index.d.ts","../src/encrypt.ts","../src/encrypt.test.ts","../src/hash.ts","../src/hash.test.ts","../src/human-hash.ts","../../protocols/dist/src/proto/gen/google/protobuf.d.ts","../../protocols/dist/src/proto/gen/dxos/credentials.d.ts","../../protocols/dist/src/proto/gen/dxos/halo/keys.d.ts","../../protocols/dist/src/proto/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert/strict.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/async_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/buffer.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/child_process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/cluster.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/console.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/constants.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/crypto.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dgram.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/diagnostics_channel.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/domain.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http2.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/https.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/inspector.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/module.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/net.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/os.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/path.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/perf_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/punycode.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/querystring.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/readline.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/repl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/consumers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/web.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/string_decoder.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tls.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/trace_events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tty.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/url.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/v8.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/vm.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/wasi.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/worker_threads.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/zlib.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.global.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/index.d.ts","../../protocols/dist/src/public-key.d.ts","../../protocols/dist/src/index.d.ts","../src/keys.ts","../../../../common/temp/node_modules/.pnpm/bip39@3.0.4/node_modules/bip39/types/_wordlists.d.ts","../../../../common/temp/node_modules/.pnpm/bip39@3.0.4/node_modules/bip39/types/index.d.ts","../src/seedphrase.ts","../src/validator.ts","../src/index.ts","../src/keys.test.ts","../src/seedphrase.test.ts","../src/shims.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/diffLines.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/printDiffs.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+jest@26.0.24/node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","3eb679a56cab01203a1ba7edeade937f6a2a4c718513b2cd930b579807fa9359","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"070fafc332546049324c5eb0559b40974f700aa78eee7a12d1486035baa39558","affectsGlobalScope":true},{"version":"eb5714694231b2e20c388bbb7dfa862780a458a07cd87b2737e6be1f6169a8ad","signature":"371f32dc57397d7fa8a5b8680e3fbb4415acab6ffe15a08d26ee856593ccf3f7"},{"version":"528215f3eec43ecbb2420cfde8d88672328129643a1586a13d86d5e80c415110","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"1127d47e6d5d89262545d064ee90a5ccef53a80f4d81eedb3221251198ec366f","signature":"4013fc0cdc2ba4c291ba160fd6204c796d0ca7dad35ea719ec9c4d00ec21305e"},{"version":"e747a4ae9c8bed522f9c9c7738775ac50455ab182f09f70498e5a7ab1260a8aa","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"89489068d5fd52b2c9fb36801606a056f5e09d525ddf0f637e3df5f433da3168","signature":"ede1f891817b1a038aef58251be9a5c1981c9aac102d9ea1b483b6abed64437f"},"011267fade3e4c99b36a9d3d14734461309de6a989f5b27ac7ac98123083e31f","3134f52cda99065c8630aa4552c7509923f76af422bb5643b3bf49bfbbd0894c","7dab91e9b6f9cb074893138261f91345371bbf053099253bc47ccdc722388da3","58ada477113e6a47d967c034a83392adfcaad478688e6916a471919d8798ff53","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","c665d5c50c2573aefd98f0ffb12c5583e333ed94294ce6f144a4163a8c84f09b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"8a215750db3e2073511e07c9e293c8c40d6109e5c7368845e060bcc12adbae6f","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","3fa48484c65913004d5abb5c0f917b61ea4684f32d05bb28c1ecfa5f05a9ed12","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"dd9ea469d1bfaf589c6a196275d35cb1aa14014707c2c46d920c7b921e8f5bca","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","0c45729ee48934bd4c5f7d2db2c93c26855bd60ddb9ed2e6b50eea540d10874a","e8ba6acb214115658895eddc9eb583d7e3ce74619b50a26bafeeb0496e08cdfd",{"version":"10c5a1fa6da1364955513ce9f41f377c0aefa32e0e29ee1920ff90137cce32ce","signature":"886cf8080ccf1b88f6756ee7adb6135ae019846fa190fc0b5a438d639063a0c3"},"b50dc1eb21ae0cf50fdad3a52298af07a6c5aa681c55ecc68b45362294dc3972","2403a8e0780ec6f1e95f3a4f922eafdda29da975f0bffe7e35cad640b333247c",{"version":"7375a5e2ea098604b887eedbe26239902a66a8b81fc7ea298c6c90df5e00c4b6","signature":"1961ebfc123d0fbcd009f1c48a6eaf89176f5122a461b371038a55cab522bc97"},{"version":"7dcc90de23c417ea963789112cc023c68f2bcf6a648339dc6baaf40ca648c29d","signature":"29a6655bb4e637e54e67ea8213a53afce35c868c2a22a8ec24ee00db751005b6"},{"version":"4dad96396ce35f34e91cfa66a0aa4deb724ed2864514e3b1bf672fe14fd31d1a","signature":"c8db534fb728faaccc0a0c300146730c8929e9483304a69d9556fe0e120061bc"},{"version":"cf0c4790c3404e84670821dfdf727fe1023ff2c9cbe1febf24f0b2a27509ccf8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"c67c641af9d44979f3e28f88e40f92290a964f8e9ef0ea8d66204c7c78032f4f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"bc6a5524c9b408e1e310ba838b5af3790cb9bdb0d60dd0d8f594ff670e770455","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true}],"options":{"composite":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":5},"fileIdsList":[[106],[106,129,131],[63,106],[66,106],[67,72,106],[68,78,79,86,95,105,106],[68,69,78,86,106],[70,106],[71,72,79,87,106],[72,95,102,106],[73,75,78,86,106],[74,106],[75,76,106],[77,78,106],[78,106],[78,79,80,95,105,106],[78,79,80,95,106],[81,86,95,105,106],[78,79,81,82,86,95,102,105,106],[81,83,95,102,105,106],[63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],[78,84,106],[85,105,106],[75,78,86,95,106],[87,106],[88,106],[66,89,106],[90,104,106,110],[91,106],[92,106],[78,93,106],[93,94,106,108],[78,95,96,97,106],[95,97,106],[95,96,106],[98,106],[99,106],[78,100,101,106],[100,101,106],[72,86,102,106],[103,106],[86,104,106],[67,81,92,105,106],[72,106],[95,106,107],[106,108],[106,109],[67,72,78,80,89,95,105,106,108,110],[95,106,111],[106,113,117],[106,125,126],[106,125,126,127,128],[106,130],[54,106],[53,63,106],[56,106],[54,56,58,106,116,119,120],[106,116],[58,63,106,115,124],[106,116,118,119],[63,106,116,118],[106,116,124],[62,106,114],[59,61,106],[60,106],[61,106],[106,113],[54,56,58,116,119,120],[58,115],[116]],"referencedMap":[[53,1],[132,2],[63,3],[64,3],[66,4],[67,5],[68,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,12],[75,13],[76,13],[77,14],[78,15],[79,16],[80,17],[65,1],[112,1],[81,18],[82,19],[83,20],[113,21],[84,22],[85,23],[86,24],[87,25],[88,26],[89,27],[90,28],[91,29],[92,30],[93,31],[94,32],[95,33],[97,34],[96,35],[98,36],[99,37],[100,38],[101,39],[102,40],[103,41],[104,42],[105,43],[106,44],[107,45],[108,46],[109,47],[110,48],[111,49],[117,1],[118,50],[125,1],[127,51],[129,52],[128,51],[126,1],[131,53],[130,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[51,1],[1,1],[10,1],[52,1],[55,54],[54,55],[57,56],[56,55],[58,1],[121,57],[122,58],[116,59],[123,60],[119,61],[124,1],[120,62],[115,63],[60,64],[61,65],[59,1],[62,66],[114,67]],"exportedModulesMap":[[53,1],[132,2],[63,3],[64,3],[66,4],[67,5],[68,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,12],[75,13],[76,13],[77,14],[78,15],[79,16],[80,17],[65,1],[112,1],[81,18],[82,19],[83,20],[113,21],[84,22],[85,23],[86,24],[87,25],[88,26],[89,27],[90,28],[91,29],[92,30],[93,31],[94,32],[95,33],[97,34],[96,35],[98,36],[99,37],[100,38],[101,39],[102,40],[103,41],[104,42],[105,43],[106,44],[107,45],[108,46],[109,47],[110,48],[111,49],[117,1],[118,50],[125,1],[127,51],[129,52],[128,51],[126,1],[131,53],[130,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[51,1],[1,1],[10,1],[52,1],[121,68],[116,69],[119,70],[124,1],[115,63],[60,64],[61,65],[59,1],[62,66],[114,67]],"semanticDiagnosticsPerFile":[53,132,63,64,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,65,112,81,82,83,113,84,85,86,87,88,89,90,91,92,93,94,95,97,96,98,99,100,101,102,103,104,105,106,107,108,109,110,111,117,118,125,127,129,128,126,131,130,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,36,41,42,37,38,39,40,8,46,43,44,45,47,9,48,49,50,51,1,10,52,55,54,57,56,58,121,122,116,123,119,124,120,115,60,61,59,62,114]},"version":"4.7.4"}
|
|
1
|
+
{"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+crypto-js@4.0.2/node_modules/@types/crypto-js/index.d.ts","../src/encrypt.ts","../src/encrypt.test.ts","../src/hash.ts","../src/hash.test.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert/strict.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/async_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/buffer.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/child_process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/cluster.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/console.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/constants.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/crypto.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dgram.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/diagnostics_channel.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/domain.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http2.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/https.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/inspector.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/module.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/net.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/os.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/path.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/perf_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/punycode.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/querystring.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/readline.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/repl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/consumers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/web.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/string_decoder.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tls.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/trace_events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tty.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/url.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/v8.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/vm.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/wasi.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/worker_threads.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/zlib.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.global.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/index.d.ts","../../protocols/dist/src/public-key.d.ts","../../protocols/dist/src/timeframe.d.ts","../../protocols/dist/src/index.d.ts","../src/keys.ts","../src/validator.ts","../src/index.ts","../src/keys.test.ts","../src/shims.d.ts","../../../../common/temp/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/index.d.ts","../../../../common/temp/node_modules/.pnpm/@sinclair+typebox@0.24.20/node_modules/@sinclair/typebox/typebox.d.ts","../../../../common/temp/node_modules/.pnpm/@jest+schemas@28.1.3/node_modules/@jest/schemas/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@28.1.3/node_modules/pretty-format/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@28.1.3/node_modules/jest-diff/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/jest-matcher-utils@28.1.3/node_modules/jest-matcher-utils/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+jest@28.1.6/node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","3eb679a56cab01203a1ba7edeade937f6a2a4c718513b2cd930b579807fa9359","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"070fafc332546049324c5eb0559b40974f700aa78eee7a12d1486035baa39558","affectsGlobalScope":true},{"version":"d0fe565f0fa42dad409fd4dd54c88e0147ae45265c8f7676cd6480595d475998","signature":"371f32dc57397d7fa8a5b8680e3fbb4415acab6ffe15a08d26ee856593ccf3f7"},{"version":"528215f3eec43ecbb2420cfde8d88672328129643a1586a13d86d5e80c415110","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e685da27ef1f60eb693a4a192a76602f6e10582141140d86a42675c97f4c28e1","signature":"4013fc0cdc2ba4c291ba160fd6204c796d0ca7dad35ea719ec9c4d00ec21305e"},{"version":"e747a4ae9c8bed522f9c9c7738775ac50455ab182f09f70498e5a7ab1260a8aa","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","c665d5c50c2573aefd98f0ffb12c5583e333ed94294ce6f144a4163a8c84f09b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"8a215750db3e2073511e07c9e293c8c40d6109e5c7368845e060bcc12adbae6f","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","3fa48484c65913004d5abb5c0f917b61ea4684f32d05bb28c1ecfa5f05a9ed12","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"dd9ea469d1bfaf589c6a196275d35cb1aa14014707c2c46d920c7b921e8f5bca","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","7ab6383af7cd92b7d19f0038816b929df737225f03eba8ec80123771c4e1360a","8bad6d59c88f12dde4174ad9a1e7375fa53349906beb1979638331a193620d54","bb4dcd8e439343e9262253b7b298b68e80914c0d7d460a0d0528abc8b06aa88b",{"version":"3b1d8489a34e7484a1b81418d5f9ebd28993b41184fe655c8ac4aec48a46e3aa","signature":"59e0e654b5b8dcd33c88648d257a9647b0e4c6748490f3c9172fa69342f2197c"},{"version":"30ba135a2560cdeeba24951c45f396dc81fda9177f044401ecfa7ae00ec14ca7","signature":"29a6655bb4e637e54e67ea8213a53afce35c868c2a22a8ec24ee00db751005b6"},{"version":"6af3a55e8433a439a494457c7dfcc5236261a91011e01311ae3ef608aa709938","signature":"a13c2a658a40bf4114df535253d98e290b9953f3afd49d564f01c24f4d17338f"},{"version":"e216bb69ecd755440c51cda214c2b2b57db13cc196486dc117c3153d3cc96883","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"bc6a5524c9b408e1e310ba838b5af3790cb9bdb0d60dd0d8f594ff670e770455","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d982cdd2610155b3cbcbfa62ccabcf2d2b739f821518ef113348d160ef0010d9","ffcc5500e77223169833fc6eb59b3a507944a1f89574e0a1276b0ea7fc22c4a4","22f13de9e2fe5f0f4724797abd3d34a1cdd6e47ef81fc4933fea3b8bf4ad524b","e3ba509d3dce019b3190ceb2f3fc88e2610ab717122dabd91a9efaa37804040d","cda0cb09b995489b7f4c57f168cd31b83dcbaa7aad49612734fb3c9c73f6e4f2",{"version":"1de1ad6a1929317171d8cfcd55bb2732257680c1bf89bcd53e1d46a4d8dbda22","affectsGlobalScope":true}],"options":{"composite":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":5},"fileIdsList":[[101,118],[101],[101,120,122],[58,101],[61,101],[62,67,101],[63,73,74,81,90,100,101],[63,64,73,81,101],[65,101],[66,67,74,82,101],[67,90,97,101],[68,70,73,81,101],[69,101],[70,71,101],[72,73,101],[73,101],[73,74,75,90,100,101],[73,74,75,90,101],[76,81,90,100,101],[73,74,76,77,81,90,97,100,101],[76,78,90,97,100,101],[58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],[73,79,101],[80,100,101],[70,73,81,90,101],[82,101],[83,101],[61,84,101],[85,99,101,105],[86,101],[87,101],[73,88,101],[88,89,101,103],[73,90,91,92,101],[90,92,101],[90,91,101],[93,101],[94,101],[73,95,96,101],[95,96,101],[67,81,97,101],[98,101],[81,99,101],[62,76,87,100,101],[67,101],[90,101,102],[101,103],[101,104],[62,67,73,75,84,90,100,101,103,105],[90,101,106],[101,120],[101,117,121],[101,119],[54,101],[53,58,101],[56,101],[54,56,101,112,113],[101,112],[58,101,111,116],[101,111,116],[101,109,110],[101,108],[101,108,109],[54,56,112,113],[111]],"referencedMap":[[119,1],[118,2],[53,2],[123,3],[58,4],[59,4],[61,5],[62,6],[63,7],[64,8],[65,9],[66,10],[67,11],[68,12],[69,13],[70,14],[71,14],[72,15],[73,16],[74,17],[75,18],[60,2],[107,2],[76,19],[77,20],[78,21],[108,22],[79,23],[80,24],[81,25],[82,26],[83,27],[84,28],[85,29],[86,30],[87,31],[88,32],[89,33],[90,34],[92,35],[91,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[105,49],[106,50],[117,2],[121,51],[122,52],[120,53],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[4,2],[24,2],[21,2],[22,2],[23,2],[25,2],[26,2],[27,2],[5,2],[28,2],[29,2],[30,2],[31,2],[6,2],[32,2],[33,2],[34,2],[35,2],[7,2],[36,2],[41,2],[42,2],[37,2],[38,2],[39,2],[40,2],[8,2],[46,2],[43,2],[44,2],[45,2],[47,2],[9,2],[48,2],[49,2],[50,2],[51,2],[1,2],[10,2],[52,2],[55,54],[54,55],[57,56],[56,55],[114,57],[115,58],[112,59],[116,2],[113,60],[111,61],[109,62],[110,63]],"exportedModulesMap":[[119,1],[118,2],[53,2],[123,3],[58,4],[59,4],[61,5],[62,6],[63,7],[64,8],[65,9],[66,10],[67,11],[68,12],[69,13],[70,14],[71,14],[72,15],[73,16],[74,17],[75,18],[60,2],[107,2],[76,19],[77,20],[78,21],[108,22],[79,23],[80,24],[81,25],[82,26],[83,27],[84,28],[85,29],[86,30],[87,31],[88,32],[89,33],[90,34],[92,35],[91,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[105,49],[106,50],[117,2],[121,51],[122,52],[120,53],[12,2],[11,2],[2,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[3,2],[4,2],[24,2],[21,2],[22,2],[23,2],[25,2],[26,2],[27,2],[5,2],[28,2],[29,2],[30,2],[31,2],[6,2],[32,2],[33,2],[34,2],[35,2],[7,2],[36,2],[41,2],[42,2],[37,2],[38,2],[39,2],[40,2],[8,2],[46,2],[43,2],[44,2],[45,2],[47,2],[9,2],[48,2],[49,2],[50,2],[51,2],[1,2],[10,2],[52,2],[114,64],[112,65],[116,2],[111,61],[109,62],[110,63]],"semanticDiagnosticsPerFile":[119,118,53,123,58,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,60,107,76,77,78,108,79,80,81,82,83,84,85,86,87,88,89,90,92,91,93,94,95,96,97,98,99,100,101,102,103,104,105,106,117,121,122,120,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,36,41,42,37,38,39,40,8,46,43,44,45,47,9,48,49,50,51,1,10,52,55,54,57,56,114,115,112,116,113,111,109,110]},"version":"4.7.4"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/crypto",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.9-dev.2637427f",
|
|
4
4
|
"description": "Basic crypto key utils",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "DXOS.org",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"types": "dist/src/index.d.ts",
|
|
9
|
+
"browser": {
|
|
10
|
+
"node:assert": "assert"
|
|
11
|
+
},
|
|
9
12
|
"files": [
|
|
10
13
|
"dist",
|
|
11
14
|
"src"
|
|
12
15
|
],
|
|
13
16
|
"dependencies": {
|
|
14
|
-
"@dxos/protocols": "2.33.
|
|
15
|
-
"
|
|
17
|
+
"@dxos/protocols": "2.33.9-dev.2637427f",
|
|
18
|
+
"assert": "^2.0.0",
|
|
16
19
|
"crypto-js": "^3.1.9-1",
|
|
17
20
|
"hypercore-crypto": "^2.3.0"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
20
23
|
"@dxos/eslint-plugin": "~1.0.34",
|
|
21
|
-
"@dxos/protocols-toolchain": "2.33.
|
|
24
|
+
"@dxos/protocols-toolchain": "2.33.8",
|
|
22
25
|
"@types/crypto-js": "~4.0.2",
|
|
23
|
-
"@types/jest": "^
|
|
26
|
+
"@types/jest": "^28.1.6",
|
|
24
27
|
"@types/node": "^16.11.27",
|
|
25
28
|
"eslint": "^7.12.1",
|
|
26
29
|
"typescript": "^4.7.2"
|
package/src/encrypt.ts
CHANGED
package/src/hash.ts
CHANGED
package/src/index.ts
CHANGED
package/src/keys.test.ts
CHANGED
|
@@ -4,24 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
// DXOS testing browser.
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
test('Basic key operations', () => {
|
|
10
|
-
const { publicKey } = createKeyPair();
|
|
11
|
-
|
|
12
|
-
expect(keyToBuffer(keyToString(publicKey))).toEqual(publicKey);
|
|
13
|
-
|
|
14
|
-
expect(() => keyToString('not-a-buffer' as any)).toThrowError();
|
|
15
|
-
expect(() => keyToBuffer('not-a-value-hex-key')).toThrowError();
|
|
16
|
-
expect(() => keyToBuffer(publicKey as any)).toThrowError();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
test('Hashing', () => {
|
|
20
|
-
const { publicKey, secretKey } = createKeyPair();
|
|
7
|
+
import { createId } from './keys';
|
|
21
8
|
|
|
9
|
+
test('Create id is unique', () => {
|
|
22
10
|
expect(createId()).not.toEqual(createId());
|
|
23
|
-
|
|
24
|
-
expect(humanize(publicKey)).not.toEqual(humanize(secretKey));
|
|
25
|
-
expect(humanize(publicKey)).toEqual(hasher.humanize(keyToString(publicKey)));
|
|
26
|
-
expect(hasher.humanize(createId())).toBeDefined();
|
|
27
11
|
});
|
package/src/keys.ts
CHANGED
|
@@ -2,26 +2,15 @@
|
|
|
2
2
|
// Copyright 2020 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import assert from 'assert';
|
|
6
5
|
import crypto from 'hypercore-crypto';
|
|
6
|
+
import assert from 'node:assert';
|
|
7
7
|
|
|
8
|
-
import { PublicKey, PublicKeyLike } from '@dxos/protocols';
|
|
8
|
+
import { PublicKey, PublicKeyLike, PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH } from '@dxos/protocols';
|
|
9
9
|
|
|
10
|
-
import { HumanHasher } from './human-hash';
|
|
11
|
-
|
|
12
|
-
export const hasher = new HumanHasher();
|
|
13
|
-
|
|
14
|
-
export const PUBLIC_KEY_LENGTH = 32; // TODO(wittjosiah): Move to protocols with PublicKey?
|
|
15
|
-
export const SECRET_KEY_LENGTH = 64;
|
|
16
10
|
export const SIGNATURE_LENGTH = 64;
|
|
17
11
|
|
|
18
12
|
export const zeroKey = () => new Uint8Array(32);
|
|
19
13
|
|
|
20
|
-
/* The purpose of this module is to assure consistent use of keys throughout the project.
|
|
21
|
-
* Keys should be maintained as buffers in objects and proto definitions, and converted to hex
|
|
22
|
-
* strings as late as possible (eg, to log/display).
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
14
|
export interface KeyPair {
|
|
26
15
|
publicKey: Buffer
|
|
27
16
|
secretKey: Buffer
|
|
@@ -37,41 +26,6 @@ export const createKeyPair = (seed?: Buffer): KeyPair => {
|
|
|
37
26
|
|
|
38
27
|
export const discoveryKey = (key: PublicKeyLike): Buffer => crypto.discoveryKey(PublicKey.from(key).asBuffer());
|
|
39
28
|
|
|
40
|
-
/**
|
|
41
|
-
* @param {string} str - Hex string representation of key.
|
|
42
|
-
* @return {Buffer} Key buffer.
|
|
43
|
-
*/
|
|
44
|
-
export const keyToBuffer = (str: string): Buffer => {
|
|
45
|
-
assert(typeof str === 'string', 'Invalid type');
|
|
46
|
-
const buffer = Buffer.from(str, 'hex');
|
|
47
|
-
assert(buffer.length === PUBLIC_KEY_LENGTH || buffer.length === SECRET_KEY_LENGTH,
|
|
48
|
-
`Invalid key length: ${buffer.length}`);
|
|
49
|
-
return buffer;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @param {Buffer | Uint8Array} buffer - Key buffer.
|
|
54
|
-
* @return {string} Hex string representation of key.
|
|
55
|
-
*/
|
|
56
|
-
export const keyToString = (buffer: PublicKeyLike): string => {
|
|
57
|
-
if (buffer instanceof PublicKey) {
|
|
58
|
-
buffer = buffer.asBuffer();
|
|
59
|
-
} else if (buffer instanceof Uint8Array) {
|
|
60
|
-
buffer = Buffer.from(buffer);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
assert(buffer instanceof Buffer, 'Invalid type');
|
|
64
|
-
return buffer.toString('hex');
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const humanize = (value: PublicKeyLike): string => {
|
|
68
|
-
if (value instanceof PublicKey || value instanceof Buffer || value instanceof Uint8Array) {
|
|
69
|
-
value = keyToString(value);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return hasher.humanize(value);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
29
|
/**
|
|
76
30
|
* Return random bytes of length.
|
|
77
31
|
* @param [length=32]
|
|
@@ -82,7 +36,8 @@ export const randomBytes = (length = 32): Buffer => crypto.randomBytes(length);
|
|
|
82
36
|
/**
|
|
83
37
|
* @return {string}
|
|
84
38
|
*/
|
|
85
|
-
|
|
39
|
+
// TODO(wittjosiah): This probably shouldn't rely on PublicKey?
|
|
40
|
+
export const createId = (): string => PublicKey.stringify(randomBytes(32));
|
|
86
41
|
|
|
87
42
|
/**
|
|
88
43
|
* Sign the contents of message with secretKey
|
package/src/validator.ts
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import { verify } from 'hypercore-crypto';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { PublicKey } from '@dxos/protocols';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Generator for signature validation function.
|
|
11
11
|
* @param {String} publicKey
|
|
12
12
|
*/
|
|
13
13
|
export const getSignatureValidator =
|
|
14
|
-
(publicKey: string) => (message: Buffer, signature: Buffer) => verify(message, signature,
|
|
14
|
+
(publicKey: string) => (message: Buffer, signature: Buffer) => verify(message, signature, PublicKey.bufferize(publicKey));
|
package/dist/src/human-hash.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* humanhash: Human-readable representations of digests.
|
|
3
|
-
*/
|
|
4
|
-
export declare class HumanHasher {
|
|
5
|
-
private readonly wordlist;
|
|
6
|
-
/**
|
|
7
|
-
* Transforms hex digests to human-readable strings.
|
|
8
|
-
*
|
|
9
|
-
* The format of these strings will look something like:
|
|
10
|
-
* `victor-bacon-zulu-lima`. The output is obtained by compressing the input
|
|
11
|
-
* digest to a fixed number of bytes, then mapping those bytes to one of 256
|
|
12
|
-
* words. A default wordlist is provided, but you can override this if you
|
|
13
|
-
* prefer.
|
|
14
|
-
* As long as you use the same wordlist, the output will be consistent (i.e.
|
|
15
|
-
* the same digest will always render the same representation).
|
|
16
|
-
*
|
|
17
|
-
* @param wordlist A list of exactly 256 words to choose from
|
|
18
|
-
*/
|
|
19
|
-
constructor(wordlist?: string[]);
|
|
20
|
-
/**
|
|
21
|
-
* Humanize a given hexadecimal digest.
|
|
22
|
-
*
|
|
23
|
-
* Change the number of words output by specifying `words`. Change the
|
|
24
|
-
* word separator with `separator`.
|
|
25
|
-
*
|
|
26
|
-
* @param hexdigest A string of hexadecimal characters to humanize
|
|
27
|
-
* @param words How many words to output (more = safer)
|
|
28
|
-
* @param separator The string used to seperate the words
|
|
29
|
-
*/
|
|
30
|
-
humanize(hexdigest: string, words?: number, separator?: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Compress a list of byte values to a fixed target length.
|
|
33
|
-
*
|
|
34
|
-
* @param bytes A list of bytes (numbers from 0-254)
|
|
35
|
-
* @param target The number of bytes to return / compress to
|
|
36
|
-
*/
|
|
37
|
-
_compress(bytes: number[], target: number): number[];
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=human-hash.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"human-hash.d.ts","sourceRoot":"","sources":["../../src/human-hash.ts"],"names":[],"mappings":"AA4CA;;GAEG;AAEH,qBAAa,WAAW;IAcT,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAbtC;;;;;;;;;;;;OAYG;gBAC2B,QAAQ,WAAmB;IAOzD;;;;;;;;;OASG;IACH,QAAQ,CAAE,SAAS,EAAE,MAAM,EAAE,KAAK,SAAI,EAAE,SAAS,SAAM;IAYvD;;;;;OAKG;IACH,SAAS,CAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM;CAqB3C"}
|
package/dist/src/human-hash.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2021 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HumanHasher = void 0;
|
|
7
|
-
// From https://github.com/SEBv15/humanhash/blob/166c1a6f70d854fe6767cdd76be1237112d4eaf1/index.js
|
|
8
|
-
const DEFAULT_WORDLIST = [
|
|
9
|
-
'ack', 'alabama', 'alanine', 'alaska', 'alpha', 'angel', 'apart', 'april',
|
|
10
|
-
'arizona', 'arkansas', 'artist', 'asparagus', 'aspen', 'august', 'autumn',
|
|
11
|
-
'avocado', 'bacon', 'bakerloo', 'batman', 'beer', 'berlin', 'beryllium',
|
|
12
|
-
'black', 'blossom', 'blue', 'bluebird', 'bravo', 'bulldog', 'burger',
|
|
13
|
-
'butter', 'california', 'carbon', 'cardinal', 'carolina', 'carpet', 'cat',
|
|
14
|
-
'ceiling', 'charlie', 'chicken', 'coffee', 'cola', 'cold', 'colorado',
|
|
15
|
-
'comet', 'connecticut', 'crazy', 'cup', 'dakota', 'december', 'delaware',
|
|
16
|
-
'delta', 'diet', 'don', 'double', 'early', 'earth', 'east', 'echo',
|
|
17
|
-
'edward', 'eight', 'eighteen', 'eleven', 'emma', 'enemy', 'equal',
|
|
18
|
-
'failed', 'fanta', 'fifteen', 'fillet', 'finch', 'fish', 'five', 'fix',
|
|
19
|
-
'floor', 'florida', 'football', 'four', 'fourteen', 'foxtrot', 'freddie',
|
|
20
|
-
'friend', 'fruit', 'gee', 'georgia', 'glucose', 'golf', 'green', 'grey',
|
|
21
|
-
'hamper', 'happy', 'harry', 'hawaii', 'helium', 'high', 'hot', 'hotel',
|
|
22
|
-
'hydrogen', 'idaho', 'illinois', 'india', 'indigo', 'ink', 'iowa',
|
|
23
|
-
'island', 'item', 'jersey', 'jig', 'johnny', 'juliet', 'july', 'jupiter',
|
|
24
|
-
'kansas', 'kentucky', 'kilo', 'king', 'kitten', 'lactose', 'lake', 'lamp',
|
|
25
|
-
'lemon', 'leopard', 'lima', 'lion', 'lithium', 'london', 'louisiana',
|
|
26
|
-
'low', 'magazine', 'magnesium', 'maine', 'mango', 'march', 'mars',
|
|
27
|
-
'maryland', 'massachusetts', 'may', 'mexico', 'michigan', 'mike',
|
|
28
|
-
'minnesota', 'mirror', 'mississippi', 'missouri', 'mobile', 'mockingbird',
|
|
29
|
-
'monkey', 'montana', 'moon', 'mountain', 'muppet', 'music', 'nebraska',
|
|
30
|
-
'neptune', 'network', 'nevada', 'nine', 'nineteen', 'nitrogen', 'north',
|
|
31
|
-
'november', 'nuts', 'october', 'ohio', 'oklahoma', 'one', 'orange',
|
|
32
|
-
'oranges', 'oregon', 'oscar', 'oven', 'oxygen', 'papa', 'paris', 'pasta',
|
|
33
|
-
'pennsylvania', 'pip', 'pizza', 'pluto', 'potato', 'princess', 'purple',
|
|
34
|
-
'quebec', 'queen', 'quiet', 'red', 'river', 'robert', 'robin', 'romeo',
|
|
35
|
-
'rugby', 'sad', 'salami', 'saturn', 'september', 'seven', 'seventeen',
|
|
36
|
-
'shade', 'sierra', 'single', 'sink', 'six', 'sixteen', 'skylark', 'snake',
|
|
37
|
-
'social', 'sodium', 'solar', 'south', 'spaghetti', 'speaker', 'spring',
|
|
38
|
-
'stairway', 'steak', 'stream', 'summer', 'sweet', 'table', 'tango', 'ten',
|
|
39
|
-
'tennessee', 'tennis', 'texas', 'thirteen', 'three', 'timing', 'triple',
|
|
40
|
-
'twelve', 'twenty', 'two', 'uncle', 'undress', 'uniform', 'uranus', 'utah',
|
|
41
|
-
'vegan', 'venus', 'vermont', 'victor', 'video', 'violet', 'virginia',
|
|
42
|
-
'washington', 'west', 'whiskey', 'white', 'william', 'winner', 'winter',
|
|
43
|
-
'wisconsin', 'wolfram', 'wyoming', 'xray', 'yankee', 'yellow', 'zebra', 'zulu'
|
|
44
|
-
];
|
|
45
|
-
/**
|
|
46
|
-
* humanhash: Human-readable representations of digests.
|
|
47
|
-
*/
|
|
48
|
-
// TODO(wittjosiah): Move to debug?
|
|
49
|
-
class HumanHasher {
|
|
50
|
-
/**
|
|
51
|
-
* Transforms hex digests to human-readable strings.
|
|
52
|
-
*
|
|
53
|
-
* The format of these strings will look something like:
|
|
54
|
-
* `victor-bacon-zulu-lima`. The output is obtained by compressing the input
|
|
55
|
-
* digest to a fixed number of bytes, then mapping those bytes to one of 256
|
|
56
|
-
* words. A default wordlist is provided, but you can override this if you
|
|
57
|
-
* prefer.
|
|
58
|
-
* As long as you use the same wordlist, the output will be consistent (i.e.
|
|
59
|
-
* the same digest will always render the same representation).
|
|
60
|
-
*
|
|
61
|
-
* @param wordlist A list of exactly 256 words to choose from
|
|
62
|
-
*/
|
|
63
|
-
constructor(wordlist = DEFAULT_WORDLIST) {
|
|
64
|
-
this.wordlist = wordlist;
|
|
65
|
-
if (wordlist.length !== 256) {
|
|
66
|
-
throw new Error('Wordlist must have exactly 256 items');
|
|
67
|
-
}
|
|
68
|
-
this.wordlist = wordlist;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Humanize a given hexadecimal digest.
|
|
72
|
-
*
|
|
73
|
-
* Change the number of words output by specifying `words`. Change the
|
|
74
|
-
* word separator with `separator`.
|
|
75
|
-
*
|
|
76
|
-
* @param hexdigest A string of hexadecimal characters to humanize
|
|
77
|
-
* @param words How many words to output (more = safer)
|
|
78
|
-
* @param separator The string used to seperate the words
|
|
79
|
-
*/
|
|
80
|
-
humanize(hexdigest, words = 4, separator = '-') {
|
|
81
|
-
const pairs = hexdigest.match(/(..?)/g);
|
|
82
|
-
if (!pairs) {
|
|
83
|
-
throw new Error('');
|
|
84
|
-
}
|
|
85
|
-
const bytes = pairs.map((x) => parseInt(x, 16));
|
|
86
|
-
const compressed = this._compress(bytes, words);
|
|
87
|
-
return compressed.map((x) => this.wordlist[x]).join(separator);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Compress a list of byte values to a fixed target length.
|
|
91
|
-
*
|
|
92
|
-
* @param bytes A list of bytes (numbers from 0-254)
|
|
93
|
-
* @param target The number of bytes to return / compress to
|
|
94
|
-
*/
|
|
95
|
-
_compress(bytes, target) {
|
|
96
|
-
const length = bytes.length;
|
|
97
|
-
if (target > length) {
|
|
98
|
-
throw new Error('Fewer input bytes than requested output');
|
|
99
|
-
}
|
|
100
|
-
// Calculate the segment size (divide and round down)
|
|
101
|
-
const segSize = length / target >> 0;
|
|
102
|
-
// Split 'bytes' array into 'target' number of segments.
|
|
103
|
-
const segments = [];
|
|
104
|
-
for (let i = 0; i < segSize * target; i += segSize) {
|
|
105
|
-
segments.push(bytes.slice(i, i + segSize));
|
|
106
|
-
}
|
|
107
|
-
// Catch any left-over bytes in the last segment.
|
|
108
|
-
segments[segments.length - 1] = segments[segments.length - 1].concat(bytes.slice(target * segSize));
|
|
109
|
-
const checksums = segments.map((x) => x.reduce((acc, curr) => acc ^ curr));
|
|
110
|
-
return checksums;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.HumanHasher = HumanHasher;
|
|
114
|
-
//# sourceMappingURL=human-hash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"human-hash.js","sourceRoot":"","sources":["../../src/human-hash.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,kGAAkG;AAElG,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;IACzE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IACzE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW;IACvE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ;IACpE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK;IACzE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IACrE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU;IACxE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;IAClE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IACjE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK;IACtE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS;IACxE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IACvE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IACtE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM;IACjE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS;IACxE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM;IACzE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW;IACpE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;IACjE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM;IAChE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa;IACzE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU;IACtE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO;IACvE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ;IAClE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IACxE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ;IACvE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO;IACtE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW;IACrE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO;IACzE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ;IACtE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK;IACzE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IACvE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM;IAC1E,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;IACpE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ;IACvE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM;CAC/E,CAAC;AAEF;;GAEG;AACH,mCAAmC;AACnC,MAAa,WAAW;IACtB;;;;;;;;;;;;OAYG;IACH,YAA8B,WAAW,gBAAgB;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;QACvD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;SACzD;QACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAE,SAAiB,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,GAAG,GAAG;QACrD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;SACrB;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAChD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAEhD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAE,KAAe,EAAE,MAAc;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC5D;QAED,qDAAqD;QACrD,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC;QAErC,wDAAwD;QACxD,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,IAAI,OAAO,EAAE;YAClD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;SAC5C;QAED,iDAAiD;QACjD,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;QAEpG,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;QAC3E,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtED,kCAsEC"}
|
package/dist/src/seedphrase.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate bip39 seed phrase (aka mnemonic).
|
|
3
|
-
*/
|
|
4
|
-
export declare const generateSeedPhrase: () => string;
|
|
5
|
-
/**
|
|
6
|
-
* Generate key pair from seed phrase.
|
|
7
|
-
*/
|
|
8
|
-
export declare const keyPairFromSeedPhrase: (seedPhrase: string) => import("./keys").KeyPair;
|
|
9
|
-
//# sourceMappingURL=seedphrase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seedphrase.d.ts","sourceRoot":"","sources":["../../src/seedphrase.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAA4B,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAAgB,MAAM,6BAIvD,CAAC"}
|
package/dist/src/seedphrase.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.keyPairFromSeedPhrase = exports.generateSeedPhrase = void 0;
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
11
|
-
const bip39_1 = require("bip39");
|
|
12
|
-
const keys_1 = require("./keys");
|
|
13
|
-
// Util functions for Identity: export, import, create.
|
|
14
|
-
/**
|
|
15
|
-
* Generate bip39 seed phrase (aka mnemonic).
|
|
16
|
-
*/
|
|
17
|
-
const generateSeedPhrase = () => (0, bip39_1.generateMnemonic)();
|
|
18
|
-
exports.generateSeedPhrase = generateSeedPhrase;
|
|
19
|
-
/**
|
|
20
|
-
* Generate key pair from seed phrase.
|
|
21
|
-
*/
|
|
22
|
-
const keyPairFromSeedPhrase = (seedPhrase) => {
|
|
23
|
-
(0, assert_1.default)(seedPhrase);
|
|
24
|
-
const seed = (0, bip39_1.mnemonicToSeedSync)(seedPhrase);
|
|
25
|
-
return (0, keys_1.createKeyPair)(seed);
|
|
26
|
-
};
|
|
27
|
-
exports.keyPairFromSeedPhrase = keyPairFromSeedPhrase;
|
|
28
|
-
//# sourceMappingURL=seedphrase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seedphrase.js","sourceRoot":"","sources":["../../src/seedphrase.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,iCAA6D;AAE7D,iCAAuC;AAEvC,uDAAuD;AAEvD;;GAEG;AACI,MAAM,kBAAkB,GAAG,GAAW,EAAE,CAAC,IAAA,wBAAgB,GAAE,CAAC;AAAtD,QAAA,kBAAkB,sBAAoC;AAEnE;;GAEG;AACI,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC1D,IAAA,gBAAM,EAAC,UAAU,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,IAAA,oBAAa,EAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seedphrase.test.d.ts","sourceRoot":"","sources":["../../src/seedphrase.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const bip39_1 = require("bip39");
|
|
7
|
-
const keys_1 = require("./keys");
|
|
8
|
-
const seedphrase_1 = require("./seedphrase");
|
|
9
|
-
it('Basic bip39 operations work', async () => {
|
|
10
|
-
const seedPhrase = (0, bip39_1.generateMnemonic)();
|
|
11
|
-
const seed = (0, bip39_1.mnemonicToSeedSync)(seedPhrase);
|
|
12
|
-
await (0, keys_1.createKeyPair)(seed.slice(0, 32));
|
|
13
|
-
});
|
|
14
|
-
it('Create keypair from seedphrase', async () => {
|
|
15
|
-
const seedPhrase = (0, seedphrase_1.generateSeedPhrase)();
|
|
16
|
-
expect(typeof seedPhrase).toBe('string');
|
|
17
|
-
expect(seedPhrase.split(/\s+/g).length).toEqual(12);
|
|
18
|
-
const recoveredKeyPair = (0, seedphrase_1.keyPairFromSeedPhrase)(seedPhrase);
|
|
19
|
-
expect(recoveredKeyPair).toBeDefined();
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=seedphrase.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seedphrase.test.js","sourceRoot":"","sources":["../../src/seedphrase.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,iCAA6D;AAE7D,iCAAuC;AACvC,6CAAyE;AAEzE,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;IAC3C,MAAM,UAAU,GAAG,IAAA,wBAAgB,GAAE,CAAC;IACtC,MAAM,IAAI,GAAG,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,IAAA,oBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC9C,MAAM,UAAU,GAAG,IAAA,+BAAkB,GAAE,CAAC;IACxC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEpD,MAAM,gBAAgB,GAAG,IAAA,kCAAqB,EAAC,UAAU,CAAC,CAAC;IAC3D,MAAM,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC,CAAC,CAAC,CAAC"}
|
package/src/human-hash.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2021 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// From https://github.com/SEBv15/humanhash/blob/166c1a6f70d854fe6767cdd76be1237112d4eaf1/index.js
|
|
6
|
-
|
|
7
|
-
const DEFAULT_WORDLIST = [
|
|
8
|
-
'ack', 'alabama', 'alanine', 'alaska', 'alpha', 'angel', 'apart', 'april',
|
|
9
|
-
'arizona', 'arkansas', 'artist', 'asparagus', 'aspen', 'august', 'autumn',
|
|
10
|
-
'avocado', 'bacon', 'bakerloo', 'batman', 'beer', 'berlin', 'beryllium',
|
|
11
|
-
'black', 'blossom', 'blue', 'bluebird', 'bravo', 'bulldog', 'burger',
|
|
12
|
-
'butter', 'california', 'carbon', 'cardinal', 'carolina', 'carpet', 'cat',
|
|
13
|
-
'ceiling', 'charlie', 'chicken', 'coffee', 'cola', 'cold', 'colorado',
|
|
14
|
-
'comet', 'connecticut', 'crazy', 'cup', 'dakota', 'december', 'delaware',
|
|
15
|
-
'delta', 'diet', 'don', 'double', 'early', 'earth', 'east', 'echo',
|
|
16
|
-
'edward', 'eight', 'eighteen', 'eleven', 'emma', 'enemy', 'equal',
|
|
17
|
-
'failed', 'fanta', 'fifteen', 'fillet', 'finch', 'fish', 'five', 'fix',
|
|
18
|
-
'floor', 'florida', 'football', 'four', 'fourteen', 'foxtrot', 'freddie',
|
|
19
|
-
'friend', 'fruit', 'gee', 'georgia', 'glucose', 'golf', 'green', 'grey',
|
|
20
|
-
'hamper', 'happy', 'harry', 'hawaii', 'helium', 'high', 'hot', 'hotel',
|
|
21
|
-
'hydrogen', 'idaho', 'illinois', 'india', 'indigo', 'ink', 'iowa',
|
|
22
|
-
'island', 'item', 'jersey', 'jig', 'johnny', 'juliet', 'july', 'jupiter',
|
|
23
|
-
'kansas', 'kentucky', 'kilo', 'king', 'kitten', 'lactose', 'lake', 'lamp',
|
|
24
|
-
'lemon', 'leopard', 'lima', 'lion', 'lithium', 'london', 'louisiana',
|
|
25
|
-
'low', 'magazine', 'magnesium', 'maine', 'mango', 'march', 'mars',
|
|
26
|
-
'maryland', 'massachusetts', 'may', 'mexico', 'michigan', 'mike',
|
|
27
|
-
'minnesota', 'mirror', 'mississippi', 'missouri', 'mobile', 'mockingbird',
|
|
28
|
-
'monkey', 'montana', 'moon', 'mountain', 'muppet', 'music', 'nebraska',
|
|
29
|
-
'neptune', 'network', 'nevada', 'nine', 'nineteen', 'nitrogen', 'north',
|
|
30
|
-
'november', 'nuts', 'october', 'ohio', 'oklahoma', 'one', 'orange',
|
|
31
|
-
'oranges', 'oregon', 'oscar', 'oven', 'oxygen', 'papa', 'paris', 'pasta',
|
|
32
|
-
'pennsylvania', 'pip', 'pizza', 'pluto', 'potato', 'princess', 'purple',
|
|
33
|
-
'quebec', 'queen', 'quiet', 'red', 'river', 'robert', 'robin', 'romeo',
|
|
34
|
-
'rugby', 'sad', 'salami', 'saturn', 'september', 'seven', 'seventeen',
|
|
35
|
-
'shade', 'sierra', 'single', 'sink', 'six', 'sixteen', 'skylark', 'snake',
|
|
36
|
-
'social', 'sodium', 'solar', 'south', 'spaghetti', 'speaker', 'spring',
|
|
37
|
-
'stairway', 'steak', 'stream', 'summer', 'sweet', 'table', 'tango', 'ten',
|
|
38
|
-
'tennessee', 'tennis', 'texas', 'thirteen', 'three', 'timing', 'triple',
|
|
39
|
-
'twelve', 'twenty', 'two', 'uncle', 'undress', 'uniform', 'uranus', 'utah',
|
|
40
|
-
'vegan', 'venus', 'vermont', 'victor', 'video', 'violet', 'virginia',
|
|
41
|
-
'washington', 'west', 'whiskey', 'white', 'william', 'winner', 'winter',
|
|
42
|
-
'wisconsin', 'wolfram', 'wyoming', 'xray', 'yankee', 'yellow', 'zebra', 'zulu'
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* humanhash: Human-readable representations of digests.
|
|
47
|
-
*/
|
|
48
|
-
// TODO(wittjosiah): Move to debug?
|
|
49
|
-
export class HumanHasher {
|
|
50
|
-
/**
|
|
51
|
-
* Transforms hex digests to human-readable strings.
|
|
52
|
-
*
|
|
53
|
-
* The format of these strings will look something like:
|
|
54
|
-
* `victor-bacon-zulu-lima`. The output is obtained by compressing the input
|
|
55
|
-
* digest to a fixed number of bytes, then mapping those bytes to one of 256
|
|
56
|
-
* words. A default wordlist is provided, but you can override this if you
|
|
57
|
-
* prefer.
|
|
58
|
-
* As long as you use the same wordlist, the output will be consistent (i.e.
|
|
59
|
-
* the same digest will always render the same representation).
|
|
60
|
-
*
|
|
61
|
-
* @param wordlist A list of exactly 256 words to choose from
|
|
62
|
-
*/
|
|
63
|
-
constructor (private readonly wordlist = DEFAULT_WORDLIST) {
|
|
64
|
-
if (wordlist.length !== 256) {
|
|
65
|
-
throw new Error('Wordlist must have exactly 256 items');
|
|
66
|
-
}
|
|
67
|
-
this.wordlist = wordlist;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Humanize a given hexadecimal digest.
|
|
72
|
-
*
|
|
73
|
-
* Change the number of words output by specifying `words`. Change the
|
|
74
|
-
* word separator with `separator`.
|
|
75
|
-
*
|
|
76
|
-
* @param hexdigest A string of hexadecimal characters to humanize
|
|
77
|
-
* @param words How many words to output (more = safer)
|
|
78
|
-
* @param separator The string used to seperate the words
|
|
79
|
-
*/
|
|
80
|
-
humanize (hexdigest: string, words = 4, separator = '-') {
|
|
81
|
-
const pairs = hexdigest.match(/(..?)/g);
|
|
82
|
-
if (!pairs) {
|
|
83
|
-
throw new Error('');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const bytes = pairs.map((x) => parseInt(x, 16));
|
|
87
|
-
const compressed = this._compress(bytes, words);
|
|
88
|
-
|
|
89
|
-
return compressed.map((x) => this.wordlist[x]).join(separator);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Compress a list of byte values to a fixed target length.
|
|
94
|
-
*
|
|
95
|
-
* @param bytes A list of bytes (numbers from 0-254)
|
|
96
|
-
* @param target The number of bytes to return / compress to
|
|
97
|
-
*/
|
|
98
|
-
_compress (bytes: number[], target: number) {
|
|
99
|
-
const length = bytes.length;
|
|
100
|
-
if (target > length) {
|
|
101
|
-
throw new Error('Fewer input bytes than requested output');
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Calculate the segment size (divide and round down)
|
|
105
|
-
const segSize = length / target >> 0;
|
|
106
|
-
|
|
107
|
-
// Split 'bytes' array into 'target' number of segments.
|
|
108
|
-
const segments = [];
|
|
109
|
-
for (let i = 0; i < segSize * target; i += segSize) {
|
|
110
|
-
segments.push(bytes.slice(i, i + segSize));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Catch any left-over bytes in the last segment.
|
|
114
|
-
segments[segments.length - 1] = segments[segments.length - 1].concat(bytes.slice(target * segSize));
|
|
115
|
-
|
|
116
|
-
const checksums = segments.map((x) => x.reduce((acc, curr) => acc ^ curr));
|
|
117
|
-
return checksums;
|
|
118
|
-
}
|
|
119
|
-
}
|
package/src/seedphrase.test.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2020 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { generateMnemonic, mnemonicToSeedSync } from 'bip39';
|
|
6
|
-
|
|
7
|
-
import { createKeyPair } from './keys';
|
|
8
|
-
import { generateSeedPhrase, keyPairFromSeedPhrase } from './seedphrase';
|
|
9
|
-
|
|
10
|
-
it('Basic bip39 operations work', async () => {
|
|
11
|
-
const seedPhrase = generateMnemonic();
|
|
12
|
-
const seed = mnemonicToSeedSync(seedPhrase);
|
|
13
|
-
await createKeyPair(seed.slice(0, 32));
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('Create keypair from seedphrase', async () => {
|
|
17
|
-
const seedPhrase = generateSeedPhrase();
|
|
18
|
-
expect(typeof seedPhrase).toBe('string');
|
|
19
|
-
expect(seedPhrase.split(/\s+/g).length).toEqual(12);
|
|
20
|
-
|
|
21
|
-
const recoveredKeyPair = keyPairFromSeedPhrase(seedPhrase);
|
|
22
|
-
expect(recoveredKeyPair).toBeDefined();
|
|
23
|
-
});
|
package/src/seedphrase.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2020 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import assert from 'assert';
|
|
6
|
-
import { generateMnemonic, mnemonicToSeedSync } from 'bip39';
|
|
7
|
-
|
|
8
|
-
import { createKeyPair } from './keys';
|
|
9
|
-
|
|
10
|
-
// Util functions for Identity: export, import, create.
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Generate bip39 seed phrase (aka mnemonic).
|
|
14
|
-
*/
|
|
15
|
-
export const generateSeedPhrase = (): string => generateMnemonic();
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Generate key pair from seed phrase.
|
|
19
|
-
*/
|
|
20
|
-
export const keyPairFromSeedPhrase = (seedPhrase: string) => {
|
|
21
|
-
assert(seedPhrase);
|
|
22
|
-
const seed = mnemonicToSeedSync(seedPhrase);
|
|
23
|
-
return createKeyPair(seed);
|
|
24
|
-
};
|