@tinta-lang/syntax 0.0.0-stage → 0.1.0-dev.0
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/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.txt +13651 -0
- package/dist/directive.d.ts +40 -0
- package/dist/editing.d.ts +46 -0
- package/dist/enrichment.d.ts +5 -0
- package/dist/expression.d.ts +26 -0
- package/dist/image-destinations.d.ts +3 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10118 -0
- package/dist/parser.d.ts +40 -0
- package/dist/registry.d.ts +144 -0
- package/dist/source.d.ts +28 -0
- package/package.json +280 -3
- package/parser-provenance.json +1419 -0
- package/patches/README.md +5 -0
- package/patches/micromark.patch +84 -0
- package/vendor/@noble/hashes/LICENSE +21 -0
- package/vendor/@noble/hashes/_md.js +209 -0
- package/vendor/@noble/hashes/_u64.js +77 -0
- package/vendor/@noble/hashes/package.json +91 -0
- package/vendor/@noble/hashes/sha2.js +446 -0
- package/vendor/@noble/hashes/utils.js +687 -0
- package/vendor/character-entities/index.js +2132 -0
- package/vendor/character-entities/license +22 -0
- package/vendor/character-entities/package.json +78 -0
- package/vendor/decode-named-character-reference/index.js +19 -0
- package/vendor/decode-named-character-reference/license +22 -0
- package/vendor/decode-named-character-reference/package.json +90 -0
- package/vendor/devlop/lib/default.js +9 -0
- package/vendor/devlop/license +22 -0
- package/vendor/devlop/package.json +80 -0
- package/vendor/longest-streak/index.js +36 -0
- package/vendor/longest-streak/license +22 -0
- package/vendor/longest-streak/package.json +73 -0
- package/vendor/markdown-table/index.js +393 -0
- package/vendor/markdown-table/license +22 -0
- package/vendor/markdown-table/package.json +77 -0
- package/vendor/mdast-util-from-markdown/index.js +2 -0
- package/vendor/mdast-util-from-markdown/lib/index.js +1270 -0
- package/vendor/mdast-util-from-markdown/license +22 -0
- package/vendor/mdast-util-from-markdown/package.json +98 -0
- package/vendor/mdast-util-gfm-strikethrough/index.js +5 -0
- package/vendor/mdast-util-gfm-strikethrough/lib/index.js +133 -0
- package/vendor/mdast-util-gfm-strikethrough/license +22 -0
- package/vendor/mdast-util-gfm-strikethrough/package.json +84 -0
- package/vendor/mdast-util-gfm-table/index.js +2 -0
- package/vendor/mdast-util-gfm-table/lib/index.js +300 -0
- package/vendor/mdast-util-gfm-table/license +22 -0
- package/vendor/mdast-util-gfm-table/package.json +101 -0
- package/vendor/mdast-util-gfm-task-list-item/index.js +4 -0
- package/vendor/mdast-util-gfm-task-list-item/lib/index.js +141 -0
- package/vendor/mdast-util-gfm-task-list-item/license +22 -0
- package/vendor/mdast-util-gfm-task-list-item/package.json +90 -0
- package/vendor/mdast-util-phrasing/index.js +1 -0
- package/vendor/mdast-util-phrasing/lib/index.js +45 -0
- package/vendor/mdast-util-phrasing/license +23 -0
- package/vendor/mdast-util-phrasing/package.json +78 -0
- package/vendor/mdast-util-to-markdown/index.js +3 -0
- package/vendor/mdast-util-to-markdown/lib/configure.js +98 -0
- package/vendor/mdast-util-to-markdown/lib/handle/blockquote.js +40 -0
- package/vendor/mdast-util-to-markdown/lib/handle/break.js +41 -0
- package/vendor/mdast-util-to-markdown/lib/handle/code.js +86 -0
- package/vendor/mdast-util-to-markdown/lib/handle/definition.js +83 -0
- package/vendor/mdast-util-to-markdown/lib/handle/emphasis.js +67 -0
- package/vendor/mdast-util-to-markdown/lib/handle/heading.js +84 -0
- package/vendor/mdast-util-to-markdown/lib/handle/html.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/handle/image-reference.js +78 -0
- package/vendor/mdast-util-to-markdown/lib/handle/image.js +92 -0
- package/vendor/mdast-util-to-markdown/lib/handle/index.js +45 -0
- package/vendor/mdast-util-to-markdown/lib/handle/inline-code.js +86 -0
- package/vendor/mdast-util-to-markdown/lib/handle/link-reference.js +78 -0
- package/vendor/mdast-util-to-markdown/lib/handle/link.js +129 -0
- package/vendor/mdast-util-to-markdown/lib/handle/list-item.js +73 -0
- package/vendor/mdast-util-to-markdown/lib/handle/list.js +107 -0
- package/vendor/mdast-util-to-markdown/lib/handle/paragraph.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/handle/root.js +34 -0
- package/vendor/mdast-util-to-markdown/lib/handle/strong.js +67 -0
- package/vendor/mdast-util-to-markdown/lib/handle/text.js +30 -0
- package/vendor/mdast-util-to-markdown/lib/handle/thematic-break.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/index.js +213 -0
- package/vendor/mdast-util-to-markdown/lib/join.js +56 -0
- package/vendor/mdast-util-to-markdown/lib/unsafe.js +160 -0
- package/vendor/mdast-util-to-markdown/lib/util/association.js +33 -0
- package/vendor/mdast-util-to-markdown/lib/util/character.js +32 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-bullet-other.js +42 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-bullet.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-emphasis.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-fence.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-list-item-indent.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-quote.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-rule-repetition.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-rule.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-strong.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/compile-pattern.js +30 -0
- package/vendor/mdast-util-to-markdown/lib/util/container-flow.js +93 -0
- package/vendor/mdast-util-to-markdown/lib/util/container-phrasing.js +704 -0
- package/vendor/mdast-util-to-markdown/lib/util/encode-character-reference.js +11 -0
- package/vendor/mdast-util-to-markdown/lib/util/encode-info.js +82 -0
- package/vendor/mdast-util-to-markdown/lib/util/format-code-as-indented.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +39 -0
- package/vendor/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +39 -0
- package/vendor/mdast-util-to-markdown/lib/util/html-kind.js +63 -0
- package/vendor/mdast-util-to-markdown/lib/util/indent-lines.js +40 -0
- package/vendor/mdast-util-to-markdown/lib/util/pattern-in-scope.js +52 -0
- package/vendor/mdast-util-to-markdown/lib/util/safe.js +263 -0
- package/vendor/mdast-util-to-markdown/lib/util/track.js +55 -0
- package/vendor/mdast-util-to-markdown/license +22 -0
- package/vendor/mdast-util-to-markdown/package.json +88 -0
- package/vendor/mdast-util-to-string/index.js +5 -0
- package/vendor/mdast-util-to-string/lib/index.js +108 -0
- package/vendor/mdast-util-to-string/license +22 -0
- package/vendor/mdast-util-to-string/package.json +78 -0
- package/vendor/micromark/index.js +60 -0
- package/vendor/micromark/lib/compile.js +1068 -0
- package/vendor/micromark/lib/constructs.js +85 -0
- package/vendor/micromark/lib/create-tokenizer.js +615 -0
- package/vendor/micromark/lib/initialize/content.js +79 -0
- package/vendor/micromark/lib/initialize/document.js +370 -0
- package/vendor/micromark/lib/initialize/flow.js +58 -0
- package/vendor/micromark/lib/initialize/text.js +216 -0
- package/vendor/micromark/lib/parse.js +56 -0
- package/vendor/micromark/lib/postprocess.js +18 -0
- package/vendor/micromark/lib/preprocess.js +112 -0
- package/vendor/micromark/license +22 -0
- package/vendor/micromark/package.json +87 -0
- package/vendor/micromark-core-commonmark/index.js +22 -0
- package/vendor/micromark-core-commonmark/lib/attention.js +231 -0
- package/vendor/micromark-core-commonmark/lib/autolink.js +233 -0
- package/vendor/micromark-core-commonmark/lib/blank-line.js +61 -0
- package/vendor/micromark-core-commonmark/lib/block-quote.js +143 -0
- package/vendor/micromark-core-commonmark/lib/character-escape.js +64 -0
- package/vendor/micromark-core-commonmark/lib/character-reference.js +149 -0
- package/vendor/micromark-core-commonmark/lib/code-fenced.js +422 -0
- package/vendor/micromark-core-commonmark/lib/code-indented.js +159 -0
- package/vendor/micromark-core-commonmark/lib/code-text.js +225 -0
- package/vendor/micromark-core-commonmark/lib/content.js +163 -0
- package/vendor/micromark-core-commonmark/lib/definition.js +254 -0
- package/vendor/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
- package/vendor/micromark-core-commonmark/lib/heading-atx.js +191 -0
- package/vendor/micromark-core-commonmark/lib/html-flow.js +827 -0
- package/vendor/micromark-core-commonmark/lib/html-text.js +678 -0
- package/vendor/micromark-core-commonmark/lib/label-end.js +561 -0
- package/vendor/micromark-core-commonmark/lib/label-start-image.js +110 -0
- package/vendor/micromark-core-commonmark/lib/label-start-link.js +63 -0
- package/vendor/micromark-core-commonmark/lib/line-ending.js +33 -0
- package/vendor/micromark-core-commonmark/lib/list.js +213 -0
- package/vendor/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/vendor/micromark-core-commonmark/lib/setext-underline.js +187 -0
- package/vendor/micromark-core-commonmark/lib/thematic-break.js +102 -0
- package/vendor/micromark-core-commonmark/license +22 -0
- package/vendor/micromark-core-commonmark/package.json +62 -0
- package/vendor/micromark-extension-gfm-strikethrough/index.js +3 -0
- package/vendor/micromark-extension-gfm-strikethrough/lib/html.js +26 -0
- package/vendor/micromark-extension-gfm-strikethrough/lib/syntax.js +142 -0
- package/vendor/micromark-extension-gfm-strikethrough/license +22 -0
- package/vendor/micromark-extension-gfm-strikethrough/package.json +129 -0
- package/vendor/micromark-extension-gfm-table/index.js +2 -0
- package/vendor/micromark-extension-gfm-table/lib/edit-map.js +222 -0
- package/vendor/micromark-extension-gfm-table/lib/html.js +135 -0
- package/vendor/micromark-extension-gfm-table/lib/infer.js +52 -0
- package/vendor/micromark-extension-gfm-table/lib/syntax.js +846 -0
- package/vendor/micromark-extension-gfm-table/license +22 -0
- package/vendor/micromark-extension-gfm-table/package.json +86 -0
- package/vendor/micromark-extension-gfm-task-list-item/index.js +2 -0
- package/vendor/micromark-extension-gfm-task-list-item/lib/html.js +29 -0
- package/vendor/micromark-extension-gfm-task-list-item/lib/syntax.js +158 -0
- package/vendor/micromark-extension-gfm-task-list-item/license +22 -0
- package/vendor/micromark-extension-gfm-task-list-item/package.json +131 -0
- package/vendor/micromark-factory-destination/index.js +206 -0
- package/vendor/micromark-factory-destination/license +22 -0
- package/vendor/micromark-factory-destination/package.json +57 -0
- package/vendor/micromark-factory-label/index.js +148 -0
- package/vendor/micromark-factory-label/license +22 -0
- package/vendor/micromark-factory-label/package.json +60 -0
- package/vendor/micromark-factory-space/index.js +116 -0
- package/vendor/micromark-factory-space/license +22 -0
- package/vendor/micromark-factory-space/package.json +46 -0
- package/vendor/micromark-factory-title/index.js +158 -0
- package/vendor/micromark-factory-title/license +22 -0
- package/vendor/micromark-factory-title/package.json +58 -0
- package/vendor/micromark-factory-whitespace/index.js +44 -0
- package/vendor/micromark-factory-whitespace/license +22 -0
- package/vendor/micromark-factory-whitespace/package.json +57 -0
- package/vendor/micromark-util-character/index.js +246 -0
- package/vendor/micromark-util-character/license +22 -0
- package/vendor/micromark-util-character/package.json +57 -0
- package/vendor/micromark-util-chunked/index.js +81 -0
- package/vendor/micromark-util-chunked/license +22 -0
- package/vendor/micromark-util-chunked/package.json +57 -0
- package/vendor/micromark-util-classify-character/index.js +27 -0
- package/vendor/micromark-util-classify-character/license +22 -0
- package/vendor/micromark-util-classify-character/package.json +59 -0
- package/vendor/micromark-util-combine-extensions/index.js +143 -0
- package/vendor/micromark-util-combine-extensions/license +22 -0
- package/vendor/micromark-util-combine-extensions/package.json +52 -0
- package/vendor/micromark-util-decode-numeric-character-reference/index.js +32 -0
- package/vendor/micromark-util-decode-numeric-character-reference/license +22 -0
- package/vendor/micromark-util-decode-numeric-character-reference/package.json +59 -0
- package/vendor/micromark-util-decode-string/index.js +45 -0
- package/vendor/micromark-util-decode-string/license +22 -0
- package/vendor/micromark-util-decode-string/package.json +63 -0
- package/vendor/micromark-util-edit-map/index.js +225 -0
- package/vendor/micromark-util-edit-map/license +22 -0
- package/vendor/micromark-util-edit-map/package.json +48 -0
- package/vendor/micromark-util-encode/index.js +33 -0
- package/vendor/micromark-util-encode/license +22 -0
- package/vendor/micromark-util-encode/package.json +47 -0
- package/vendor/micromark-util-html-tag-name/index.js +93 -0
- package/vendor/micromark-util-html-tag-name/license +22 -0
- package/vendor/micromark-util-html-tag-name/package.json +47 -0
- package/vendor/micromark-util-normalize-identifier/index.js +33 -0
- package/vendor/micromark-util-normalize-identifier/license +22 -0
- package/vendor/micromark-util-normalize-identifier/package.json +58 -0
- package/vendor/micromark-util-resolve-all/index.js +32 -0
- package/vendor/micromark-util-resolve-all/license +22 -0
- package/vendor/micromark-util-resolve-all/package.json +48 -0
- package/vendor/micromark-util-sanitize-uri/index.js +107 -0
- package/vendor/micromark-util-sanitize-uri/license +22 -0
- package/vendor/micromark-util-sanitize-uri/package.json +59 -0
- package/vendor/micromark-util-subtokenize/index.js +228 -0
- package/vendor/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
- package/vendor/micromark-util-subtokenize/license +22 -0
- package/vendor/micromark-util-subtokenize/package.json +60 -0
- package/vendor/unist-util-is/index.js +7 -0
- package/vendor/unist-util-is/lib/index.js +296 -0
- package/vendor/unist-util-is/license +22 -0
- package/vendor/unist-util-is/package.json +103 -0
- package/vendor/unist-util-stringify-position/index.js +1 -0
- package/vendor/unist-util-stringify-position/lib/index.js +84 -0
- package/vendor/unist-util-stringify-position/license +22 -0
- package/vendor/unist-util-stringify-position/package.json +80 -0
- package/vendor/unist-util-visit/index.js +2 -0
- package/vendor/unist-util-visit/lib/index.js +312 -0
- package/vendor/unist-util-visit/license +22 -0
- package/vendor/unist-util-visit/package.json +108 -0
- package/vendor/unist-util-visit-parents/index.js +2 -0
- package/vendor/unist-util-visit-parents/lib/color.js +7 -0
- package/vendor/unist-util-visit-parents/lib/index.js +399 -0
- package/vendor/unist-util-visit-parents/license +22 -0
- package/vendor/unist-util-visit-parents/package.json +106 -0
- package/vendor/zwitch/index.js +118 -0
- package/vendor/zwitch/license +22 -0
- package/vendor/zwitch/package.json +72 -0
- package/README.md +0 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Bounded Markdown tokenizer
|
|
2
|
+
|
|
3
|
+
`micromark@4.0.3.patch` adds an optional internal `observeTokenizer` callback to the locked parser, in both production and development entry points. It reports each state-machine transition before execution and each token entry before allocation. The syntax package uses this to enforce its shared compile-operation budget and incremental Markdown container-depth ceiling. No source-controlled callback, grammar change, runtime IO or new dependency version is introduced.
|
|
4
|
+
|
|
5
|
+
The patch is recorded by hash in the lockfile. Frozen installation applies it to the official package whose integrity and license remain in the dependency inventory. The complete official CommonMark corpus runs against this patched parser, and budget exhaustion is tested in both source profiles. Removing the hook would fail the ordinary-Markdown operation-budget regression.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
diff --git a/dev/lib/create-tokenizer.js b/dev/lib/create-tokenizer.js
|
|
2
|
+
index b61ae359768d4541d16b40fb74a1294783ab4547..bea244489250fba394e32a7c35ac484477e810c1 100644
|
|
3
|
+
--- a/dev/lib/create-tokenizer.js
|
|
4
|
+
+++ b/dev/lib/create-tokenizer.js
|
|
5
|
+
@@ -64,7 +64,7 @@ const debug = createDebug('micromark')
|
|
6
|
+
* @returns {TokenizeContext}
|
|
7
|
+
* Context.
|
|
8
|
+
*/
|
|
9
|
+
-export function createTokenizer(parser, initialize, from) {
|
|
10
|
+
+export function createTokenizer(parser, initialize, from, observeTokenizer) {
|
|
11
|
+
/** @type {Point} */
|
|
12
|
+
let point = {
|
|
13
|
+
_bufferIndex: -1,
|
|
14
|
+
@@ -231,6 +231,7 @@ export function createTokenizer(parser, initialize, from) {
|
|
15
|
+
* Nothing.
|
|
16
|
+
*/
|
|
17
|
+
function go(code) {
|
|
18
|
+
+ observeTokenizer?.('transition', point.offset)
|
|
19
|
+
assert(consumed === true, 'expected character to be consumed')
|
|
20
|
+
consumed = undefined
|
|
21
|
+
debug('main: passing `%s` to %s', code, state && state.name)
|
|
22
|
+
@@ -295,6 +296,7 @@ export function createTokenizer(parser, initialize, from) {
|
|
23
|
+
|
|
24
|
+
/** @type {Effects['enter']} */
|
|
25
|
+
function enter(type, fields) {
|
|
26
|
+
+ observeTokenizer?.('enter', point.offset, type, stack)
|
|
27
|
+
/** @type {Token} */
|
|
28
|
+
// @ts-expect-error Patch instead of assign required fields to help GC.
|
|
29
|
+
const token = fields || {}
|
|
30
|
+
diff --git a/dev/lib/parse.js b/dev/lib/parse.js
|
|
31
|
+
index ffb0f88a2b90ab4605f4961617bd766f5c3af1e0..01c9507590cfef2c6ffa19b4d25387b267684725 100644
|
|
32
|
+
--- a/dev/lib/parse.js
|
|
33
|
+
+++ b/dev/lib/parse.js
|
|
34
|
+
@@ -52,7 +52,7 @@ export function parse(options) {
|
|
35
|
+
return creator
|
|
36
|
+
/** @type {Create} */
|
|
37
|
+
function creator(from) {
|
|
38
|
+
- return createTokenizer(parser, initial, from)
|
|
39
|
+
+ return createTokenizer(parser, initial, from, settings.observeTokenizer)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
diff --git a/lib/create-tokenizer.js b/lib/create-tokenizer.js
|
|
44
|
+
index ad8b247adbb0c5baf8686ad411ca494e467948dc..5f545954ec935c8832b5e89c7aba0fc535bbb729 100644
|
|
45
|
+
--- a/lib/create-tokenizer.js
|
|
46
|
+
+++ b/lib/create-tokenizer.js
|
|
47
|
+
@@ -58,7 +58,7 @@ import { resolveAll } from 'micromark-util-resolve-all';
|
|
48
|
+
* @returns {TokenizeContext}
|
|
49
|
+
* Context.
|
|
50
|
+
*/
|
|
51
|
+
-export function createTokenizer(parser, initialize, from) {
|
|
52
|
+
+export function createTokenizer(parser, initialize, from, observeTokenizer) {
|
|
53
|
+
/** @type {Point} */
|
|
54
|
+
let point = {
|
|
55
|
+
_bufferIndex: -1,
|
|
56
|
+
@@ -228,6 +228,7 @@ export function createTokenizer(parser, initialize, from) {
|
|
57
|
+
* Nothing.
|
|
58
|
+
*/
|
|
59
|
+
function go(code) {
|
|
60
|
+
+ observeTokenizer?.('transition', point.offset)
|
|
61
|
+
consumed = undefined;
|
|
62
|
+
expectedCode = code;
|
|
63
|
+
state = state(code);
|
|
64
|
+
@@ -271,6 +272,7 @@ export function createTokenizer(parser, initialize, from) {
|
|
65
|
+
|
|
66
|
+
/** @type {Effects['enter']} */
|
|
67
|
+
function enter(type, fields) {
|
|
68
|
+
+ observeTokenizer?.('enter', point.offset, type, stack)
|
|
69
|
+
/** @type {Token} */
|
|
70
|
+
// @ts-expect-error Patch instead of assign required fields to help GC.
|
|
71
|
+
const token = fields || {};
|
|
72
|
+
diff --git a/lib/parse.js b/lib/parse.js
|
|
73
|
+
index 468231986a450bae77540807dba5b655ab3becfd..10a33e945ed853cdcbe04c6a606644f94b35dbc6 100644
|
|
74
|
+
--- a/lib/parse.js
|
|
75
|
+
+++ b/lib/parse.js
|
|
76
|
+
@@ -50,7 +50,7 @@ export function parse(options) {
|
|
77
|
+
return creator;
|
|
78
|
+
/** @type {Create} */
|
|
79
|
+
function creator(from) {
|
|
80
|
+
- return createTokenizer(parser, initial, from);
|
|
81
|
+
+ return createTokenizer(parser, initial, from, settings.observeTokenizer);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal Merkle-Damgard hash utils.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { setU64FromNum } from "./_u64.js";
|
|
6
|
+
import { abytes, aexists, aoutput, createView } from "./utils.js";
|
|
7
|
+
/**
|
|
8
|
+
* Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.
|
|
9
|
+
* Returns bits from `b` when `a` is set, otherwise from `c`.
|
|
10
|
+
* The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never
|
|
11
|
+
* set the same bit.
|
|
12
|
+
* @param a - selector word
|
|
13
|
+
* @param b - word chosen when selector bit is set
|
|
14
|
+
* @param c - word chosen when selector bit is clear
|
|
15
|
+
* @returns Mixed 32-bit word.
|
|
16
|
+
* @example
|
|
17
|
+
* Combine three words with the shared 32-bit choice primitive.
|
|
18
|
+
* ```ts
|
|
19
|
+
* Chi(0xffffffff, 0x12345678, 0x87654321);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function Chi(a, b, c) {
|
|
23
|
+
return (a & b) ^ (~a & c);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Shared 32-bit majority primitive reused by SHA-256 and SHA-1.
|
|
27
|
+
* Returns bits shared by at least two inputs.
|
|
28
|
+
* @param a - first input word
|
|
29
|
+
* @param b - second input word
|
|
30
|
+
* @param c - third input word
|
|
31
|
+
* @returns Mixed 32-bit word.
|
|
32
|
+
* @example
|
|
33
|
+
* Combine three words with the shared 32-bit majority primitive.
|
|
34
|
+
* ```ts
|
|
35
|
+
* Maj(0xffffffff, 0x12345678, 0x87654321);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export function Maj(a, b, c) {
|
|
39
|
+
return (a & b) ^ (a & c) ^ (b & c);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Merkle-Damgard hash construction base class.
|
|
43
|
+
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
|
44
|
+
* Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit
|
|
45
|
+
* strings with partial-byte tails.
|
|
46
|
+
* @param blockLen - internal block size in bytes
|
|
47
|
+
* @param outputLen - digest size in bytes
|
|
48
|
+
* @param padOffset - trailing length field size in bytes
|
|
49
|
+
* @param isLE - whether length and state words are encoded in little-endian
|
|
50
|
+
* @example
|
|
51
|
+
* Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { _SHA1 } from '@noble/hashes/legacy.js';
|
|
54
|
+
* const hash = new _SHA1();
|
|
55
|
+
* hash.update(new Uint8Array([97, 98, 99]));
|
|
56
|
+
* hash.digest();
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export class HashMD {
|
|
60
|
+
blockLen;
|
|
61
|
+
outputLen;
|
|
62
|
+
canXOF = false;
|
|
63
|
+
padOffset;
|
|
64
|
+
isLE;
|
|
65
|
+
// For partial updates less than block size
|
|
66
|
+
buffer;
|
|
67
|
+
view;
|
|
68
|
+
finished = false;
|
|
69
|
+
length = 0;
|
|
70
|
+
pos = 0;
|
|
71
|
+
destroyed = false;
|
|
72
|
+
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
73
|
+
this.blockLen = blockLen;
|
|
74
|
+
this.outputLen = outputLen;
|
|
75
|
+
this.padOffset = padOffset;
|
|
76
|
+
this.isLE = isLE;
|
|
77
|
+
this.buffer = new Uint8Array(blockLen);
|
|
78
|
+
this.view = createView(this.buffer);
|
|
79
|
+
}
|
|
80
|
+
update(data) {
|
|
81
|
+
aexists(this);
|
|
82
|
+
abytes(data);
|
|
83
|
+
const { view, buffer, blockLen } = this;
|
|
84
|
+
const len = data.length;
|
|
85
|
+
let processed = false;
|
|
86
|
+
for (let pos = 0; pos < len;) {
|
|
87
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
88
|
+
// Fast path only when there is no buffered partial block: `take === blockLen` implies
|
|
89
|
+
// `this.pos === 0`, so we can process full blocks directly from the input view.
|
|
90
|
+
if (take === blockLen) {
|
|
91
|
+
const dataView = createView(data);
|
|
92
|
+
for (; blockLen <= len - pos; pos += blockLen)
|
|
93
|
+
this.process(dataView, pos);
|
|
94
|
+
processed = true;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
// When the whole input is buffered in one go (common for short messages), passing `data`
|
|
98
|
+
// directly avoids allocating a subarray view.
|
|
99
|
+
buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
|
|
100
|
+
this.pos += take;
|
|
101
|
+
pos += take;
|
|
102
|
+
if (this.pos === blockLen) {
|
|
103
|
+
this.process(view, 0);
|
|
104
|
+
this.pos = 0;
|
|
105
|
+
processed = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
this.length += data.length;
|
|
109
|
+
// Shared schedule buffers only pick up input-derived words inside process(); if everything
|
|
110
|
+
// was buffered without processing, there is nothing to zero.
|
|
111
|
+
if (processed)
|
|
112
|
+
this.roundClean();
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
digestInto(out) {
|
|
116
|
+
aexists(this);
|
|
117
|
+
aoutput(out, this);
|
|
118
|
+
this.finished = true;
|
|
119
|
+
// Padding
|
|
120
|
+
// We can avoid allocation of buffer for padding completely if it
|
|
121
|
+
// was previously not allocated here. But it won't change performance.
|
|
122
|
+
const { buffer, view, blockLen, isLE } = this;
|
|
123
|
+
let { pos } = this;
|
|
124
|
+
// append the bit '1' to the message, then zero-pad the rest of the block
|
|
125
|
+
buffer[pos++] = 0b10000000;
|
|
126
|
+
buffer.fill(0, pos);
|
|
127
|
+
// we have less than padOffset left in buffer, so we cannot put length in
|
|
128
|
+
// current block, need process it and pad again
|
|
129
|
+
if (this.padOffset > blockLen - pos) {
|
|
130
|
+
this.process(view, 0);
|
|
131
|
+
buffer.fill(0);
|
|
132
|
+
}
|
|
133
|
+
// `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from
|
|
134
|
+
// the padding fill above, and JS will overflow before user input can make that half non-zero.
|
|
135
|
+
// So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an
|
|
136
|
+
// integer below 2**53, so the split inside the helper stays exact).
|
|
137
|
+
setU64FromNum(view, blockLen - 8, this.length * 8, isLE);
|
|
138
|
+
this.process(view, 0);
|
|
139
|
+
// The final block above is processed outside update(), so the shared message-schedule
|
|
140
|
+
// buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().
|
|
141
|
+
this.roundClean();
|
|
142
|
+
// digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.
|
|
143
|
+
const oview = out === buffer ? view : createView(out);
|
|
144
|
+
const len = this.outputLen;
|
|
145
|
+
// NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT
|
|
146
|
+
const outLen = len / 4;
|
|
147
|
+
const state = this.get();
|
|
148
|
+
// Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.
|
|
149
|
+
if (len % 4 || outLen > state.length)
|
|
150
|
+
throw new Error('invalid outputLen');
|
|
151
|
+
for (let i = 0; i < outLen; i++)
|
|
152
|
+
oview.setUint32(4 * i, state[i], isLE);
|
|
153
|
+
}
|
|
154
|
+
digest() {
|
|
155
|
+
const { buffer, outputLen } = this;
|
|
156
|
+
this.digestInto(buffer);
|
|
157
|
+
// Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return
|
|
158
|
+
// fresh bytes to the caller.
|
|
159
|
+
const res = buffer.slice(0, outputLen);
|
|
160
|
+
this.destroy();
|
|
161
|
+
return res;
|
|
162
|
+
}
|
|
163
|
+
_cloneIntoMeta(to) {
|
|
164
|
+
const { buffer, length, finished, destroyed, pos } = this;
|
|
165
|
+
to.destroyed = destroyed;
|
|
166
|
+
to.finished = finished;
|
|
167
|
+
to.length = length;
|
|
168
|
+
to.pos = pos;
|
|
169
|
+
// Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and
|
|
170
|
+
// later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.
|
|
171
|
+
if (pos)
|
|
172
|
+
to.buffer.set(buffer); // Avoid a hot modulo guard.
|
|
173
|
+
return to;
|
|
174
|
+
}
|
|
175
|
+
clone() {
|
|
176
|
+
return this._cloneInto();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
|
181
|
+
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
|
182
|
+
*/
|
|
183
|
+
/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the
|
|
184
|
+
* square roots of the first eight prime numbers. Exported as a shared table; callers must treat
|
|
185
|
+
* it as read-only because constructors copy words from it by index. */
|
|
186
|
+
export const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
187
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
|
188
|
+
]);
|
|
189
|
+
/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must
|
|
190
|
+
* treat it as read-only because constructors copy words from it by index. */
|
|
191
|
+
export const SHA224_IV = /* @__PURE__ */ Uint32Array.from([
|
|
192
|
+
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,
|
|
193
|
+
]);
|
|
194
|
+
/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen
|
|
195
|
+
* big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth
|
|
196
|
+
* through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only
|
|
197
|
+
* because constructors copy halves from it by index. */
|
|
198
|
+
export const SHA384_IV = /* @__PURE__ */ Uint32Array.from([
|
|
199
|
+
0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,
|
|
200
|
+
0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,
|
|
201
|
+
]);
|
|
202
|
+
/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen
|
|
203
|
+
* big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first
|
|
204
|
+
* eight prime numbers. Exported as a shared table; callers must treat it as read-only because
|
|
205
|
+
* constructors copy halves from it by index. */
|
|
206
|
+
export const SHA512_IV = /* @__PURE__ */ Uint32Array.from([
|
|
207
|
+
0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,
|
|
208
|
+
0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,
|
|
209
|
+
]);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();
|
|
2
|
+
const _32n = /* @__PURE__ */ BigInt(32);
|
|
3
|
+
// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high
|
|
4
|
+
// }` to match little-endian word order rather than the property names.
|
|
5
|
+
function fromBig(n, le = false) {
|
|
6
|
+
if (le)
|
|
7
|
+
return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };
|
|
8
|
+
return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
9
|
+
}
|
|
10
|
+
// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array
|
|
11
|
+
// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.
|
|
12
|
+
function split(lst, le = false) {
|
|
13
|
+
const len = lst.length;
|
|
14
|
+
let Ah = new Uint32Array(len);
|
|
15
|
+
let Al = new Uint32Array(len);
|
|
16
|
+
for (let i = 0; i < len; i++) {
|
|
17
|
+
const { h, l } = fromBig(lst[i], le);
|
|
18
|
+
[Ah[i], Al[i]] = [h, l];
|
|
19
|
+
}
|
|
20
|
+
return [Ah, Al];
|
|
21
|
+
}
|
|
22
|
+
// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS
|
|
23
|
+
// bitwise results back to uint32 first, and little-endian callers must swap.
|
|
24
|
+
const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);
|
|
25
|
+
// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers
|
|
26
|
+
// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below
|
|
27
|
+
// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).
|
|
28
|
+
const fromNumH = (n) => (n / 2 ** 32) | 0;
|
|
29
|
+
const fromNumL = (n) => n >>> 0;
|
|
30
|
+
// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call
|
|
31
|
+
// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.
|
|
32
|
+
function setU64FromNum(view, byteOffset, n, isLE) {
|
|
33
|
+
const h = fromNumH(n);
|
|
34
|
+
const l = fromNumL(n);
|
|
35
|
+
view.setUint32(byteOffset, isLE ? l : h, isLE);
|
|
36
|
+
view.setUint32(byteOffset + 4, isLE ? h : l, isLE);
|
|
37
|
+
}
|
|
38
|
+
// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.
|
|
39
|
+
const shrSH = (h, _l, s) => h >>> s;
|
|
40
|
+
// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.
|
|
41
|
+
const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
|
|
42
|
+
// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.
|
|
43
|
+
const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));
|
|
44
|
+
// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.
|
|
45
|
+
const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);
|
|
46
|
+
// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.
|
|
47
|
+
const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));
|
|
48
|
+
// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.
|
|
49
|
+
const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));
|
|
50
|
+
// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.
|
|
51
|
+
const rotr32H = (_h, l) => l;
|
|
52
|
+
// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.
|
|
53
|
+
const rotr32L = (h, _l) => h;
|
|
54
|
+
// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps
|
|
55
|
+
// local copies so V8 inlines them into keccakP.
|
|
56
|
+
// Add two split 64-bit words and return the split `{ h, l }` sum.
|
|
57
|
+
// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out
|
|
58
|
+
// of the low sum and instead use division.
|
|
59
|
+
function add(Ah, Al, Bh, Bl) {
|
|
60
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
61
|
+
return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };
|
|
62
|
+
}
|
|
63
|
+
// Addition with more than 2 elements
|
|
64
|
+
// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.
|
|
65
|
+
const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
66
|
+
// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.
|
|
67
|
+
const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;
|
|
68
|
+
// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.
|
|
69
|
+
const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
70
|
+
// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.
|
|
71
|
+
const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;
|
|
72
|
+
// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.
|
|
73
|
+
const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
74
|
+
// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.
|
|
75
|
+
const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;
|
|
76
|
+
// prettier-ignore
|
|
77
|
+
export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@noble/hashes",
|
|
3
|
+
"version": "2.4.0",
|
|
4
|
+
"description": "Audited & minimal 0-dependency JS implementation of SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF & Scrypt",
|
|
5
|
+
"files": [
|
|
6
|
+
"*.js",
|
|
7
|
+
"*.d.ts",
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@paulmillr/jsbt": "0.7.1",
|
|
12
|
+
"bismar": "0.1.8",
|
|
13
|
+
"@types/node": "26.2.0",
|
|
14
|
+
"fast-check": "4.2.0",
|
|
15
|
+
"prettier": "3.9.6",
|
|
16
|
+
"typescript": "6.0.3"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"benchmark": "node benchmark/hashes.ts",
|
|
20
|
+
"benchmark:thirdparty": "cd benchmark/thirdparty; npm ci; JSBT_BENCHMARK_DIMENSIONS='algorithm,buffer,library' node hashes.ts",
|
|
21
|
+
"benchmark:thirdparty-scrypt": "cd benchmark/thirdparty; npm ci; JSBT_BENCHMARK_DIMENSIONS='iters,library' FILTER='async' node scrypt.ts",
|
|
22
|
+
"benchmark:size": "bismar -bsm",
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"build:clean": "rm *.{js,d.ts} 2> /dev/null",
|
|
25
|
+
"check": "jsbt-check",
|
|
26
|
+
"format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'",
|
|
27
|
+
"test": "node test/index.ts",
|
|
28
|
+
"test:dos": "node test/slow-dos.test.ts",
|
|
29
|
+
"test:slow": "node test/slow-big.test.ts",
|
|
30
|
+
"test:acvp": "node test/slow-acvp.test.ts",
|
|
31
|
+
"test:kdf": "node test/slow-kdf.test.ts",
|
|
32
|
+
"test:ultra": "node test/slow-ultra.test.ts",
|
|
33
|
+
"test:ultra:scrypt": "node test/slow-extreme-scrypt.test.ts"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": "./index.js",
|
|
37
|
+
"./_md.js": "./_md.js",
|
|
38
|
+
"./argon2.js": "./argon2.js",
|
|
39
|
+
"./blake1.js": "./blake1.js",
|
|
40
|
+
"./blake2.js": "./blake2.js",
|
|
41
|
+
"./blake3.js": "./blake3.js",
|
|
42
|
+
"./eskdf.js": "./eskdf.js",
|
|
43
|
+
"./hkdf.js": "./hkdf.js",
|
|
44
|
+
"./hmac.js": "./hmac.js",
|
|
45
|
+
"./legacy.js": "./legacy.js",
|
|
46
|
+
"./pbkdf2.js": "./pbkdf2.js",
|
|
47
|
+
"./scrypt.js": "./scrypt.js",
|
|
48
|
+
"./sha2.js": "./sha2.js",
|
|
49
|
+
"./sha3-addons.js": "./sha3-addons.js",
|
|
50
|
+
"./sha3.js": "./sha3.js",
|
|
51
|
+
"./webcrypto.js": "./webcrypto.js",
|
|
52
|
+
"./utils.js": "./utils.js"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">= 20.19.0"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"sha1",
|
|
59
|
+
"sha2",
|
|
60
|
+
"sha3",
|
|
61
|
+
"blake",
|
|
62
|
+
"blake2",
|
|
63
|
+
"blake3",
|
|
64
|
+
"hmac",
|
|
65
|
+
"hkdf",
|
|
66
|
+
"pbkdf2",
|
|
67
|
+
"scrypt",
|
|
68
|
+
"sha256",
|
|
69
|
+
"sha512",
|
|
70
|
+
"keccak",
|
|
71
|
+
"ripemd160",
|
|
72
|
+
"kdf",
|
|
73
|
+
"hash",
|
|
74
|
+
"cryptography",
|
|
75
|
+
"security",
|
|
76
|
+
"noble"
|
|
77
|
+
],
|
|
78
|
+
"homepage": "https://paulmillr.com/noble/",
|
|
79
|
+
"funding": "https://paulmillr.com/funding/",
|
|
80
|
+
"repository": {
|
|
81
|
+
"type": "git",
|
|
82
|
+
"url": "git+https://github.com/paulmillr/noble-hashes.git"
|
|
83
|
+
},
|
|
84
|
+
"type": "module",
|
|
85
|
+
"main": "index.js",
|
|
86
|
+
"module": "index.js",
|
|
87
|
+
"types": "index.d.ts",
|
|
88
|
+
"sideEffects": false,
|
|
89
|
+
"author": "Paul Miller (https://paulmillr.com)",
|
|
90
|
+
"license": "MIT"
|
|
91
|
+
}
|