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

Commit 9683b72

Browse files
authored
Merge pull request #21 from kumavis/update-crypto-table
Update crypto table
2 parents 93d770c + add24a5 commit 9683b72

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"bs58": "^3.0.0"
4040
},
4141
"devDependencies": {
42-
"aegir": "^3.0.1",
42+
"aegir": "^9.1.2",
4343
"buffer-equal": "1.0.0",
4444
"chai": "^3.5.0",
4545
"pre-commit": "^1.1.2"

Diff for: src/constants.js

+36-7
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
}

Diff for: test/index.spec.js

+2-1
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)