Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.

Commit add24a5

Browse files
committed
update hash code table
1 parent fc053ba commit add24a5

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

src/constants.js

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
1+
/* eslint quote-props: off */
2+
/* eslint key-spacing: off */
13
'use strict'
24

35
exports.names = {
4-
sha1: 0x11,
5-
'sha2-256': 0x12,
6-
'sha2-512': 0x13,
7-
sha3: 0x14,
8-
blake2b: 0x40,
9-
blake2s: 0x41
6+
'sha1': 0x11,
7+
'sha2-256': 0x12,
8+
'sha2-512': 0x13,
9+
'sha3-224': 0x17,
10+
'sha3-256': 0x16,
11+
'sha3-384': 0x15,
12+
'sha3-512': 0x14,
13+
'shake-128': 0x18,
14+
'shake-256': 0x19,
15+
'keccak-224': 0x1A,
16+
'keccak-256': 0x1B,
17+
'keccak-384': 0x1C,
18+
'keccak-512': 0x1D,
19+
'blake2b': 0x40,
20+
'blake2s': 0x41
1021
}
1122

1223
exports.codes = {
1324
0x11: 'sha1',
1425
0x12: 'sha2-256',
1526
0x13: 'sha2-512',
16-
0x14: 'sha3',
27+
0x17: 'sha3-224',
28+
0x16: 'sha3-256',
29+
0x15: 'sha3-384',
30+
0x14: 'sha3-512',
31+
0x18: 'shake-128',
32+
0x19: 'shake-256',
33+
0x1A: 'keccak-224',
34+
0x1B: 'keccak-256',
35+
0x1C: 'keccak-384',
36+
0x1D: 'keccak-512',
1737
0x40: 'blake2b',
1838
0x41: 'blake2s'
1939
}
@@ -22,7 +42,16 @@ exports.defaultLengths = {
2242
0x11: 20,
2343
0x12: 32,
2444
0x13: 64,
45+
0x17: 28,
46+
0x16: 32,
47+
0x15: 48,
2548
0x14: 64,
49+
0x18: 32,
50+
0x19: 64,
51+
0x1A: 28,
52+
0x1B: 32,
53+
0x1C: 48,
54+
0x1D: 64,
2655
0x40: 64,
2756
0x41: 32
2857
}

test/index.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-env mocha */
2+
/* eslint max-nested-callbacks: off */
23
'use strict'
34

45
const expect = require('chai').expect
@@ -260,7 +261,7 @@ describe('mh', () => {
260261
sha1: 0x11,
261262
'sha2-256': 0x12,
262263
'sha2-512': 0x13,
263-
sha3: 0x14,
264+
'sha3-512': 0x14,
264265
blake2b: 0x40,
265266
blake2s: 0x41
266267
}

0 commit comments

Comments
 (0)