stated-protocol-parser 1.0.4 → 1.0.5
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/constants.js +19 -16
- package/dist/constants.js.map +1 -1
- package/dist/esm/constants.d.ts +47 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +47 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/hash.browser.d.ts +31 -0
- package/dist/esm/hash.browser.d.ts.map +1 -0
- package/dist/esm/hash.browser.js +58 -0
- package/dist/esm/hash.browser.js.map +1 -0
- package/dist/esm/hash.node.d.ts +31 -0
- package/dist/esm/hash.node.d.ts.map +1 -0
- package/dist/esm/hash.node.js +43 -0
- package/dist/esm/hash.node.js.map +1 -0
- package/dist/esm/hash.test.d.ts +2 -0
- package/dist/esm/hash.test.d.ts.map +1 -0
- package/dist/esm/hash.test.js +181 -0
- package/dist/esm/hash.test.js.map +1 -0
- package/dist/esm/index.d.ts +44 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +643 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.test.d.ts +2 -0
- package/dist/esm/index.test.d.ts.map +1 -0
- package/dist/esm/index.test.js +293 -0
- package/dist/esm/index.test.js.map +1 -0
- package/dist/esm/types.d.ts +149 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.d.ts +4 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +23 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/esm/v3.d.ts +5 -0
- package/dist/esm/v3.d.ts.map +1 -0
- package/dist/esm/v3.js +60 -0
- package/dist/esm/v3.js.map +1 -0
- package/dist/hash.browser.js +12 -5
- package/dist/hash.browser.js.map +1 -1
- package/dist/hash.node.js +17 -7
- package/dist/hash.node.js.map +1 -1
- package/dist/hash.test.js +40 -38
- package/dist/hash.test.js.map +1 -1
- package/dist/index.js +95 -46
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +26 -24
- package/dist/index.test.js.map +1 -1
- package/dist/types.js +2 -1
- package/dist/utils.js +17 -12
- package/dist/utils.js.map +1 -1
- package/dist/v3.js +7 -3
- package/dist/v3.js.map +1 -1
- package/package.json +6 -13
package/dist/esm/v3.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { UTCFormat } from './constants';
|
|
2
|
+
export const parsePollV3 = (s, version) => {
|
|
3
|
+
const pollRegex = new RegExp(''
|
|
4
|
+
+ /^\n\tType: Poll\n/.source
|
|
5
|
+
+ /(?:\tPoll type: (?<pollType>[^\n]+?)\n)?/.source
|
|
6
|
+
+ /(?:\tWho can vote: (?<scopeDescription>[^\n]+?)\n)?/.source
|
|
7
|
+
+ /(?:\tLink to query defining who can vote: (?<scopeQueryLink>[^\n]+?)\n)?/.source
|
|
8
|
+
+ /(?:\tCountry scope: (?<country>[^\n]+?)\n)?/.source
|
|
9
|
+
+ /(?:\tCity scope: (?<city>[^\n]+?)\n)?/.source
|
|
10
|
+
+ /(?:\tLegal form scope: (?<legalEntity>[^\n]+?)\n)?/.source
|
|
11
|
+
+ /(?:\tDomain scope: (?<domainScope>[^\n]+?)\n)?/.source
|
|
12
|
+
+ /(?:\tThe decision is finalized when the following nodes agree: (?<judges>[^\n]+?)\n)?/.source
|
|
13
|
+
+ /(?:\tVoting deadline: (?<deadline>[^\n]+?)\n)?/.source
|
|
14
|
+
+ /\tPoll: (?<poll>[^\n]+?)\n/.source
|
|
15
|
+
+ /(?:\tOption 1: (?<option1>[^\n]+?)\n)?/.source
|
|
16
|
+
+ /(?:\tOption 2: (?<option2>[^\n]+?)\n)?/.source
|
|
17
|
+
+ /(?:\tOption 3: (?<option3>[^\n]+?)\n)?/.source
|
|
18
|
+
+ /(?:\tOption 4: (?<option4>[^\n]+?)\n)?/.source
|
|
19
|
+
+ /(?:\tOption 5: (?<option5>[^\n]+?)\n)?/.source
|
|
20
|
+
+ /$/.source);
|
|
21
|
+
const match = s.match(pollRegex);
|
|
22
|
+
if (!match)
|
|
23
|
+
throw new Error("Invalid poll format: " + s);
|
|
24
|
+
const m = {
|
|
25
|
+
pollType: match[1],
|
|
26
|
+
scopeDescription: match[2],
|
|
27
|
+
scopeQueryLink: match[3],
|
|
28
|
+
country: match[4],
|
|
29
|
+
city: match[5],
|
|
30
|
+
legalEntity: match[6],
|
|
31
|
+
domainScope: match[7],
|
|
32
|
+
judges: match[8],
|
|
33
|
+
deadline: match[9],
|
|
34
|
+
poll: match[10],
|
|
35
|
+
option1: match[11],
|
|
36
|
+
option2: match[12],
|
|
37
|
+
option3: match[13],
|
|
38
|
+
option4: match[14],
|
|
39
|
+
option5: match[15]
|
|
40
|
+
};
|
|
41
|
+
const options = [m.option1, m.option2, m.option3, m.option4, m.option5].filter(o => o);
|
|
42
|
+
const domainScope = m.domainScope?.split(', ');
|
|
43
|
+
const deadlineStr = m.deadline;
|
|
44
|
+
if (!deadlineStr.match(UTCFormat))
|
|
45
|
+
throw new Error("Invalid poll, deadline must be in UTC: " + deadlineStr);
|
|
46
|
+
return {
|
|
47
|
+
pollType: m['pollType'],
|
|
48
|
+
country: m['country'],
|
|
49
|
+
scopeDescription: m['scopeDescription'],
|
|
50
|
+
scopeQueryLink: m['scopeQueryLink'],
|
|
51
|
+
city: m['city'],
|
|
52
|
+
legalEntity: m['legalEntity'],
|
|
53
|
+
domainScope: (domainScope && domainScope.length > 0) ? domainScope : undefined,
|
|
54
|
+
judges: m['judges'],
|
|
55
|
+
deadline: new Date(deadlineStr),
|
|
56
|
+
poll: m['poll'],
|
|
57
|
+
options
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=v3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3.js","sourceRoot":"","sources":["../../src/v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM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dist/hash.browser.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Browser-compatible hash utilities using Web Crypto API
|
|
3
4
|
* Async operations for client-side use
|
|
4
5
|
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.toUrlSafeBase64 = exports.fromUrlSafeBase64 = exports.verify = exports.sha256 = void 0;
|
|
5
8
|
/**
|
|
6
9
|
* Compute SHA-256 hash of a string and return it as URL-safe base64
|
|
7
10
|
* Works in both browser and Node.js environments
|
|
8
11
|
* @param input - The string or buffer to hash
|
|
9
12
|
* @returns URL-safe base64 encoded hash
|
|
10
13
|
*/
|
|
11
|
-
|
|
14
|
+
const sha256 = async (input) => {
|
|
12
15
|
let data;
|
|
13
16
|
if (typeof input === 'string') {
|
|
14
17
|
const encoder = new TextEncoder();
|
|
@@ -26,33 +29,37 @@ export const sha256 = async (input) => {
|
|
|
26
29
|
const urlSafe = base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
27
30
|
return urlSafe;
|
|
28
31
|
};
|
|
32
|
+
exports.sha256 = sha256;
|
|
29
33
|
/**
|
|
30
34
|
* Verify that content matches a given hash
|
|
31
35
|
* @param content - The content to verify
|
|
32
36
|
* @param hash - The expected hash
|
|
33
37
|
* @returns True if the hash matches
|
|
34
38
|
*/
|
|
35
|
-
|
|
36
|
-
const computed = await sha256(content);
|
|
39
|
+
const verify = async (content, hash) => {
|
|
40
|
+
const computed = await (0, exports.sha256)(content);
|
|
37
41
|
return computed === hash;
|
|
38
42
|
};
|
|
43
|
+
exports.verify = verify;
|
|
39
44
|
/**
|
|
40
45
|
* Convert URL-safe base64 back to standard base64
|
|
41
46
|
* @param urlSafe - URL-safe base64 string
|
|
42
47
|
* @returns Standard base64 string with padding
|
|
43
48
|
*/
|
|
44
|
-
|
|
49
|
+
const fromUrlSafeBase64 = (urlSafe) => {
|
|
45
50
|
const base64 = urlSafe.replace(/-/g, '+').replace(/_/g, '/');
|
|
46
51
|
// Add padding if needed
|
|
47
52
|
const padding = '='.repeat((4 - (base64.length % 4)) % 4);
|
|
48
53
|
return base64 + padding;
|
|
49
54
|
};
|
|
55
|
+
exports.fromUrlSafeBase64 = fromUrlSafeBase64;
|
|
50
56
|
/**
|
|
51
57
|
* Convert standard base64 to URL-safe base64
|
|
52
58
|
* @param base64 - Standard base64 string
|
|
53
59
|
* @returns URL-safe base64 string without padding
|
|
54
60
|
*/
|
|
55
|
-
|
|
61
|
+
const toUrlSafeBase64 = (base64) => {
|
|
56
62
|
return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
57
63
|
};
|
|
64
|
+
exports.toUrlSafeBase64 = toUrlSafeBase64;
|
|
58
65
|
//# sourceMappingURL=hash.browser.js.map
|
package/dist/hash.browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.browser.js","sourceRoot":"","sources":["../src/hash.browser.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"hash.browser.js","sourceRoot":"","sources":["../src/hash.browser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACI,MAAM,MAAM,GAAG,KAAK,EAAE,KAA0B,EAAmB,EAAE;IACxE,IAAI,IAAgB,CAAC;IAErB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACJ,IAAI,GAAG,KAAK,CAAC;IACjB,CAAC;IAED,yEAAyE;IACzE,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,I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AAK,EAAE,GAAG,CAAC,CAAC;AAC5E,CAAC,CAAA;AAFY,QAAA,eAAe,mBAE3B"}
|
package/dist/hash.node.js
CHANGED
|
@@ -1,43 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Node.js-specific hash utilities using native crypto module
|
|
3
4
|
* Synchronous operations for server-side use
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.toUrlSafeBase64 = exports.fromUrlSafeBase64 = exports.verify = exports.sha256 = void 0;
|
|
11
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
6
12
|
/**
|
|
7
13
|
* Compute SHA-256 hash and return as URL-safe base64 (Node.js)
|
|
8
14
|
* @param input - String or buffer to hash
|
|
9
15
|
* @returns URL-safe base64 encoded hash
|
|
10
16
|
*/
|
|
11
|
-
|
|
12
|
-
const base64 =
|
|
17
|
+
const sha256 = (input) => {
|
|
18
|
+
const base64 = crypto_1.default.createHash('sha256').update(input).digest('base64');
|
|
13
19
|
const urlSafe = base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
14
20
|
return urlSafe;
|
|
15
21
|
};
|
|
22
|
+
exports.sha256 = sha256;
|
|
16
23
|
/**
|
|
17
24
|
* Verify that content matches a given hash
|
|
18
25
|
* @param content - Content to verify
|
|
19
26
|
* @param hash - Expected hash
|
|
20
27
|
* @returns True if hash matches
|
|
21
28
|
*/
|
|
22
|
-
|
|
23
|
-
return hash === sha256(content);
|
|
29
|
+
const verify = (content, hash) => {
|
|
30
|
+
return hash === (0, exports.sha256)(content);
|
|
24
31
|
};
|
|
32
|
+
exports.verify = verify;
|
|
25
33
|
/**
|
|
26
34
|
* Convert URL-safe base64 back to standard base64
|
|
27
35
|
* @param urlSafe - URL-safe base64 string
|
|
28
36
|
* @returns Standard base64 string with padding
|
|
29
37
|
*/
|
|
30
|
-
|
|
38
|
+
const fromUrlSafeBase64 = (urlSafe) => {
|
|
31
39
|
const base64 = urlSafe.replace(/-/g, '+').replace(/_/g, '/');
|
|
32
40
|
const padding = '='.repeat((4 - (base64.length % 4)) % 4);
|
|
33
41
|
return base64 + padding;
|
|
34
42
|
};
|
|
43
|
+
exports.fromUrlSafeBase64 = fromUrlSafeBase64;
|
|
35
44
|
/**
|
|
36
45
|
* Convert standard base64 to URL-safe base64
|
|
37
46
|
* @param base64 - Standard base64 string
|
|
38
47
|
* @returns URL-safe base64 string without padding
|
|
39
48
|
*/
|
|
40
|
-
|
|
49
|
+
const toUrlSafeBase64 = (base64) => {
|
|
41
50
|
return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
42
51
|
};
|
|
52
|
+
exports.toUrlSafeBase64 = toUrlSafeBase64;
|
|
43
53
|
//# sourceMappingURL=hash.node.js.map
|
package/dist/hash.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.node.js","sourceRoot":"","sources":["../src/hash.node.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"hash.node.js","sourceRoot":"","sources":["../src/hash.node.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oDAA2B;AAE3B;;;;GAIG;AACI,MAAM,MAAM,GAAG,CAAC,KAAwB,EAAU,EAAE;IACvD,MAAM,MAAM,GAAG,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IACzE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAChF,OAAO,OAAO,CAAA;AAClB,CAAC,CAAA;AAJY,QAAA,MAAM,UAIlB;AAED;;;;;GAKG;AACI,MAAM,MAAM,GAAG,CAAC,OAA0B,EAAE,IAAY,EAAW,EAAE;IACxE,OAAO,IAAI,KAAK,IAAA,cAAM,EAAC,OAAO,CAAC,CAAA;AACnC,CAAC,CAAA;AAFY,QAAA,MAAM,UAElB;AAED;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAU,EAAE;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,GAAG,OAAO,CAAC;AAC5B,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B;AAED;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,MAAc,EAAU,EAAE;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC5E,CAAC,CAAA;AAFY,QAAA,eAAe,mBAE3B"}
|
package/dist/hash.test.js
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hash_node_1 = require("./hash.node");
|
|
2
4
|
describe('Hash utilities', () => {
|
|
3
5
|
describe('sha256', () => {
|
|
4
6
|
it('should hash a simple string', () => {
|
|
5
7
|
const input = 'hello world';
|
|
6
|
-
const hash = sha256(input);
|
|
8
|
+
const hash = (0, hash_node_1.sha256)(input);
|
|
7
9
|
// Verify it's URL-safe (no +, /, or =)
|
|
8
10
|
expect(hash).not.toContain('+');
|
|
9
11
|
expect(hash).not.toContain('/');
|
|
10
12
|
expect(hash).not.toContain('=');
|
|
11
13
|
// Verify consistent output
|
|
12
|
-
const hash2 = sha256(input);
|
|
14
|
+
const hash2 = (0, hash_node_1.sha256)(input);
|
|
13
15
|
expect(hash).toBe(hash2);
|
|
14
16
|
});
|
|
15
17
|
it('should produce correct hash for known input', () => {
|
|
16
18
|
const input = 'hello world';
|
|
17
19
|
const expectedHash = 'uU0nuZNNPgilLlLX2n2r-sSE7-N6U4DukIj3rOLvzek';
|
|
18
|
-
const hash = sha256(input);
|
|
20
|
+
const hash = (0, hash_node_1.sha256)(input);
|
|
19
21
|
expect(hash).toBe(expectedHash);
|
|
20
22
|
});
|
|
21
23
|
it('should handle empty string', () => {
|
|
22
|
-
const hash = sha256('');
|
|
24
|
+
const hash = (0, hash_node_1.sha256)('');
|
|
23
25
|
expect(hash).toBeTruthy();
|
|
24
26
|
expect(typeof hash).toBe('string');
|
|
25
27
|
});
|
|
26
28
|
it('should handle unicode characters', () => {
|
|
27
29
|
const input = '你好世界 🌍';
|
|
28
|
-
const hash = sha256(input);
|
|
30
|
+
const hash = (0, hash_node_1.sha256)(input);
|
|
29
31
|
expect(hash).toBeTruthy();
|
|
30
32
|
expect(typeof hash).toBe('string');
|
|
31
33
|
// Verify consistency
|
|
32
|
-
const hash2 = sha256(input);
|
|
34
|
+
const hash2 = (0, hash_node_1.sha256)(input);
|
|
33
35
|
expect(hash).toBe(hash2);
|
|
34
36
|
});
|
|
35
37
|
it('should handle Buffer input', () => {
|
|
36
38
|
const data = Buffer.from('hello world');
|
|
37
|
-
const hash = sha256(data);
|
|
39
|
+
const hash = (0, hash_node_1.sha256)(data);
|
|
38
40
|
// Should produce same hash as string input
|
|
39
|
-
const stringHash = sha256('hello world');
|
|
41
|
+
const stringHash = (0, hash_node_1.sha256)('hello world');
|
|
40
42
|
expect(hash).toBe(stringHash);
|
|
41
43
|
});
|
|
42
44
|
it('should produce different hashes for different inputs', () => {
|
|
43
|
-
const hash1 = sha256('hello');
|
|
44
|
-
const hash2 = sha256('world');
|
|
45
|
+
const hash1 = (0, hash_node_1.sha256)('hello');
|
|
46
|
+
const hash2 = (0, hash_node_1.sha256)('world');
|
|
45
47
|
expect(hash1).not.toBe(hash2);
|
|
46
48
|
});
|
|
47
49
|
it('should produce 43-character URL-safe base64 string', () => {
|
|
48
|
-
const hash = sha256('test');
|
|
50
|
+
const hash = (0, hash_node_1.sha256)('test');
|
|
49
51
|
// SHA-256 produces 256 bits = 32 bytes
|
|
50
52
|
// Base64 encoding: 32 bytes * 4/3 = 42.67, rounded up = 43 chars (without padding)
|
|
51
53
|
expect(hash.length).toBe(43);
|
|
@@ -54,27 +56,27 @@ describe('Hash utilities', () => {
|
|
|
54
56
|
describe('verify', () => {
|
|
55
57
|
it('should verify correct hash', () => {
|
|
56
58
|
const content = 'hello world';
|
|
57
|
-
const hash = sha256(content);
|
|
58
|
-
const isValid = verify(content, hash);
|
|
59
|
+
const hash = (0, hash_node_1.sha256)(content);
|
|
60
|
+
const isValid = (0, hash_node_1.verify)(content, hash);
|
|
59
61
|
expect(isValid).toBe(true);
|
|
60
62
|
});
|
|
61
63
|
it('should reject incorrect hash', () => {
|
|
62
64
|
const content = 'hello world';
|
|
63
65
|
const wrongHash = 'incorrect_hash_value_here_1234567890';
|
|
64
|
-
const isValid = verify(content, wrongHash);
|
|
66
|
+
const isValid = (0, hash_node_1.verify)(content, wrongHash);
|
|
65
67
|
expect(isValid).toBe(false);
|
|
66
68
|
});
|
|
67
69
|
it('should reject hash for different content', () => {
|
|
68
70
|
const content1 = 'hello world';
|
|
69
71
|
const content2 = 'goodbye world';
|
|
70
|
-
const hash1 = sha256(content1);
|
|
71
|
-
const isValid = verify(content2, hash1);
|
|
72
|
+
const hash1 = (0, hash_node_1.sha256)(content1);
|
|
73
|
+
const isValid = (0, hash_node_1.verify)(content2, hash1);
|
|
72
74
|
expect(isValid).toBe(false);
|
|
73
75
|
});
|
|
74
76
|
it('should work with Buffer', () => {
|
|
75
77
|
const data = Buffer.from('test data');
|
|
76
|
-
const hash = sha256(data);
|
|
77
|
-
const isValid = verify(data, hash);
|
|
78
|
+
const hash = (0, hash_node_1.sha256)(data);
|
|
79
|
+
const isValid = (0, hash_node_1.verify)(data, hash);
|
|
78
80
|
expect(isValid).toBe(true);
|
|
79
81
|
});
|
|
80
82
|
});
|
|
@@ -82,7 +84,7 @@ describe('Hash utilities', () => {
|
|
|
82
84
|
it('should convert URL-safe base64 to standard base64', () => {
|
|
83
85
|
// Use a URL-safe string that contains both - and _ characters
|
|
84
86
|
const urlSafe = 'abc-def_ghi';
|
|
85
|
-
const standard = fromUrlSafeBase64(urlSafe);
|
|
87
|
+
const standard = (0, hash_node_1.fromUrlSafeBase64)(urlSafe);
|
|
86
88
|
// Should replace - with + and _ with /
|
|
87
89
|
expect(standard).toContain('+');
|
|
88
90
|
expect(standard).toContain('/');
|
|
@@ -98,21 +100,21 @@ describe('Hash utilities', () => {
|
|
|
98
100
|
{ input: 'abcdef', expectedPadding: 2 },
|
|
99
101
|
];
|
|
100
102
|
testCases.forEach(({ input, expectedPadding }) => {
|
|
101
|
-
const result = fromUrlSafeBase64(input);
|
|
103
|
+
const result = (0, hash_node_1.fromUrlSafeBase64)(input);
|
|
102
104
|
const paddingCount = (result.match(/=/g) || []).length;
|
|
103
105
|
expect(paddingCount).toBe(expectedPadding);
|
|
104
106
|
});
|
|
105
107
|
});
|
|
106
108
|
it('should handle strings without special characters', () => {
|
|
107
109
|
const input = 'abcdefghijklmnop';
|
|
108
|
-
const result = fromUrlSafeBase64(input);
|
|
110
|
+
const result = (0, hash_node_1.fromUrlSafeBase64)(input);
|
|
109
111
|
expect(result).toBeTruthy();
|
|
110
112
|
});
|
|
111
113
|
});
|
|
112
114
|
describe('toUrlSafeBase64', () => {
|
|
113
115
|
it('should convert standard base64 to URL-safe', () => {
|
|
114
116
|
const standard = 'uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=';
|
|
115
|
-
const urlSafe = toUrlSafeBase64(standard);
|
|
117
|
+
const urlSafe = (0, hash_node_1.toUrlSafeBase64)(standard);
|
|
116
118
|
// Should not contain standard base64 special characters
|
|
117
119
|
expect(urlSafe).not.toContain('+');
|
|
118
120
|
expect(urlSafe).not.toContain('/');
|
|
@@ -122,15 +124,15 @@ describe('Hash utilities', () => {
|
|
|
122
124
|
});
|
|
123
125
|
it('should remove padding', () => {
|
|
124
126
|
const withPadding = 'abc=';
|
|
125
|
-
const result = toUrlSafeBase64(withPadding);
|
|
127
|
+
const result = (0, hash_node_1.toUrlSafeBase64)(withPadding);
|
|
126
128
|
expect(result).not.toContain('=');
|
|
127
129
|
expect(result).toBe('abc');
|
|
128
130
|
});
|
|
129
131
|
it('should be reversible with fromUrlSafeBase64', () => {
|
|
130
132
|
// Start with a standard base64 string with special chars
|
|
131
133
|
const original = 'test+data/with==';
|
|
132
|
-
const urlSafe = toUrlSafeBase64(original);
|
|
133
|
-
const restored = fromUrlSafeBase64(urlSafe);
|
|
134
|
+
const urlSafe = (0, hash_node_1.toUrlSafeBase64)(original);
|
|
135
|
+
const restored = (0, hash_node_1.fromUrlSafeBase64)(urlSafe);
|
|
134
136
|
// Should restore to equivalent base64 (padding might differ slightly)
|
|
135
137
|
expect(restored.replace(/=+$/, '')).toBe(original.replace(/=+$/, ''));
|
|
136
138
|
});
|
|
@@ -138,42 +140,42 @@ describe('Hash utilities', () => {
|
|
|
138
140
|
describe('Round-trip conversions', () => {
|
|
139
141
|
it('should maintain hash integrity through URL-safe conversion', () => {
|
|
140
142
|
const content = 'test content for hashing';
|
|
141
|
-
const hash = sha256(content);
|
|
143
|
+
const hash = (0, hash_node_1.sha256)(content);
|
|
142
144
|
// Convert to standard base64 and back
|
|
143
|
-
const standard = fromUrlSafeBase64(hash);
|
|
144
|
-
const backToUrlSafe = toUrlSafeBase64(standard);
|
|
145
|
+
const standard = (0, hash_node_1.fromUrlSafeBase64)(hash);
|
|
146
|
+
const backToUrlSafe = (0, hash_node_1.toUrlSafeBase64)(standard);
|
|
145
147
|
expect(backToUrlSafe).toBe(hash);
|
|
146
148
|
});
|
|
147
149
|
it('should verify hash after conversion', () => {
|
|
148
150
|
const content = 'verification test';
|
|
149
|
-
const hash = sha256(content);
|
|
151
|
+
const hash = (0, hash_node_1.sha256)(content);
|
|
150
152
|
// Convert and back
|
|
151
|
-
const standard = fromUrlSafeBase64(hash);
|
|
152
|
-
const urlSafe = toUrlSafeBase64(standard);
|
|
153
|
+
const standard = (0, hash_node_1.fromUrlSafeBase64)(hash);
|
|
154
|
+
const urlSafe = (0, hash_node_1.toUrlSafeBase64)(standard);
|
|
153
155
|
// Should still verify
|
|
154
|
-
const isValid = verify(content, urlSafe);
|
|
156
|
+
const isValid = (0, hash_node_1.verify)(content, urlSafe);
|
|
155
157
|
expect(isValid).toBe(true);
|
|
156
158
|
});
|
|
157
159
|
});
|
|
158
160
|
describe('Edge cases', () => {
|
|
159
161
|
it('should handle very long strings', () => {
|
|
160
162
|
const longString = 'a'.repeat(10000);
|
|
161
|
-
const hash = sha256(longString);
|
|
163
|
+
const hash = (0, hash_node_1.sha256)(longString);
|
|
162
164
|
expect(hash).toBeTruthy();
|
|
163
165
|
expect(hash.length).toBe(43);
|
|
164
166
|
});
|
|
165
167
|
it('should handle special characters', () => {
|
|
166
168
|
const special = '!@#$%^&*()_+-=[]{}|;:,.<>?';
|
|
167
|
-
const hash = sha256(special);
|
|
169
|
+
const hash = (0, hash_node_1.sha256)(special);
|
|
168
170
|
expect(hash).toBeTruthy();
|
|
169
|
-
const isValid = verify(special, hash);
|
|
171
|
+
const isValid = (0, hash_node_1.verify)(special, hash);
|
|
170
172
|
expect(isValid).toBe(true);
|
|
171
173
|
});
|
|
172
174
|
it('should handle newlines and whitespace', () => {
|
|
173
175
|
const withNewlines = 'line1\nline2\r\nline3\ttab';
|
|
174
|
-
const hash = sha256(withNewlines);
|
|
176
|
+
const hash = (0, hash_node_1.sha256)(withNewlines);
|
|
175
177
|
expect(hash).toBeTruthy();
|
|
176
|
-
const isValid = verify(withNewlines, hash);
|
|
178
|
+
const isValid = (0, hash_node_1.verify)(withNewlines, hash);
|
|
177
179
|
expect(isValid).toBe(true);
|
|
178
180
|
});
|
|
179
181
|
});
|
package/dist/hash.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.test.js","sourceRoot":"","sources":["../src/hash.test.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"hash.test.js","sourceRoot":"","sources":["../src/hash.test.ts"],"names":[],"mappings":";;AAAA,2CAAiF;AAEjF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACnC,MAAM,KAAK,GAAG,aAAa,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAA,kBAAM,EAAC,KAAK,CAAC,CAAC;YAE3B,uCAAuC;YACvC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAEhC,2BAA2B;YAC3B,MAAM,KAAK,GAAG,IAAA,kBAAM,EAAC,KAAK,CAAC,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACnD,MAAM,KAAK,GAAG,aAAa,CAAC;YAC5B,MAAM,YAAY,GAAG,6CAA6C,CAAC;YACnE,MA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