Commit b7c6ad5
crypto: add outputLength option to crypto.createHash
This change adds an outputLength option to crypto.createHash which
allows users to produce variable-length hash values using XOF hash
functons.
Fixes: #28757
PR-URL: #28805
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>1 parent d3426ee commit b7c6ad5Copy full SHA for b7c6ad5
File tree
Expand file treeCollapse file tree
5 files changed
+133
-11
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/crypto
- src
- test/parallel
Expand file treeCollapse file tree
5 files changed
+133
-11
lines changedOpen diff view settings
Collapse file
+6-1Lines changed: 6 additions & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1785 | 1785 | |
1786 | 1786 | |
1787 | 1787 | |
| 1788 | + |
| 1789 | + |
| 1790 | + |
| 1791 | + |
1788 | 1792 | |
1789 | 1793 | |
1790 | 1794 | |
1791 | 1795 | |
1792 | 1796 | |
1793 | 1797 | |
1794 | 1798 | |
1795 | | - |
| 1799 | + |
| 1800 | + |
1796 | 1801 | |
1797 | 1802 | |
1798 | 1803 | |
|
Collapse file
lib/internal/crypto/hash.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/hash.js+5-2Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
25 | 25 | |
26 | 26 | |
27 | 27 | |
28 | | - |
| 28 | + |
29 | 29 | |
30 | 30 | |
31 | 31 | |
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
40 | 43 | |
41 | 44 | |
42 | 45 | |
|
Collapse file
+49-4Lines changed: 49 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4569 | 4569 | |
4570 | 4570 | |
4571 | 4571 | |
| 4572 | + |
| 4573 | + |
| 4574 | + |
| 4575 | + |
| 4576 | + |
| 4577 | + |
4572 | 4578 | |
4573 | | - |
| 4579 | + |
4574 | 4580 | |
4575 | 4581 | |
4576 | 4582 | |
4577 | 4583 | |
4578 | 4584 | |
4579 | 4585 | |
4580 | | - |
| 4586 | + |
4581 | 4587 | |
4582 | 4588 | |
4583 | 4589 | |
| ||
4586 | 4592 | |
4587 | 4593 | |
4588 | 4594 | |
| 4595 | + |
| 4596 | + |
| 4597 | + |
| 4598 | + |
| 4599 | + |
| 4600 | + |
| 4601 | + |
| 4602 | + |
| 4603 | + |
| 4604 | + |
| 4605 | + |
| 4606 | + |
4589 | 4607 | |
4590 | 4608 | |
4591 | 4609 | |
| ||
4634 | 4652 | |
4635 | 4653 | |
4636 | 4654 | |
4637 | | - |
| 4655 | + |
| 4656 | + |
| 4657 | + |
| 4658 | + |
| 4659 | + |
| 4660 | + |
| 4661 | + |
| 4662 | + |
| 4663 | + |
4638 | 4664 | |
4639 | 4665 | |
4640 | 4666 | |
4641 | 4667 | |
4642 | 4668 | |
4643 | | - |
| 4669 | + |
| 4670 | + |
| 4671 | + |
| 4672 | + |
| 4673 | + |
| 4674 | + |
| 4675 | + |
| 4676 | + |
| 4677 | + |
| 4678 | + |
| 4679 | + |
| 4680 | + |
| 4681 | + |
| 4682 | + |
| 4683 | + |
| 4684 | + |
| 4685 | + |
| 4686 | + |
| 4687 | + |
| 4688 | + |
4644 | 4689 | |
4645 | 4690 | |
4646 | 4691 | |
|
Collapse file
+7-4Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
585 | 585 | |
586 | 586 | |
587 | 587 | |
588 | | - |
| 588 | + |
589 | 589 | |
590 | 590 | |
591 | 591 | |
| ||
596 | 596 | |
597 | 597 | |
598 | 598 | |
599 | | - |
| 599 | + |
| 600 | + |
600 | 601 | |
601 | 602 | |
602 | 603 | |
603 | 604 | |
604 | | - |
| 605 | + |
| 606 | + |
605 | 607 | |
606 | 608 | |
607 | 609 | |
608 | 610 | |
609 | | - |
| 611 | + |
610 | 612 | |
| 613 | + |
611 | 614 | |
612 | 615 | |
613 | 616 | |
|
Collapse file
test/parallel/test-crypto-hash.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-hash.js+66Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
185 | 185 | |
186 | 186 | |
187 | 187 | |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
0 commit comments