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

Commit

Permalink
fix: add missing md{4,5} hash codes
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg authored and jacobheun committed Mar 31, 2020
1 parent 00d5e23 commit 010f8cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
5 changes: 5 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ exports.names = Object.freeze({
'keccak-512': 0x1D,
'murmur3-128': 0x22,
'murmur3-32': 0x23,
'md4': 0xd4,
'md5': 0xd5,
'blake2b-8': 0xb201,
'blake2b-16': 0xb202,
'blake2b-24': 0xb203,
Expand Down Expand Up @@ -364,6 +366,9 @@ exports.codes = Object.freeze({
0x22: 'murmur3-128',
0x23: 'murmur3-32',

0xd4: 'md4',
0xd5: 'md5',

// blake2
0xb201: 'blake2b-8',
0xb202: 'blake2b-16',
Expand Down
23 changes: 10 additions & 13 deletions test/fixtures/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,14 @@ module.exports = [
hex: '2c26b46b68ffc68ff99b453c1d30413413',
size: 17
},
/* TODO: murmur3 not listed in constants.js
{
encoding: {
code: 0x22,
name: 'murmur3'
name: 'murmur3-128'
},
hex: '243ddb9e',
size: 4
},
*/
{
encoding: {
code: 0x1b,
Expand Down Expand Up @@ -113,15 +111,14 @@ module.exports = [
},
hex: '4bca2b137edc580fe50a88983ef860ebaca36c857b1f492839d6d7392452a63c82cbebc68e3b70a2a1480b4bb5d437a7cba6ecf9d89f9ff3ccd14cd6146ea7e7',
size: 64
},
{
encoding: {
code: 0xd5,
name: 'md5',
varint: 'd501'
},
hex: 'd41d8cd98f00b204e9800998ecf8427e',
size: 16
}
/* TODO: md5 not listed in constants.js
{
encoding: {
code: 0xd5,
name: 'md5'
},
hex: 'd41d8cd98f00b204e9800998ecf8427e',
size: 16
}
*/
]

0 comments on commit 010f8cd

Please sign in to comment.