This repository was archived by the owner on Aug 24, 2021. It is now read-only.
File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,15 @@ const toBuf = utils.toBuf
11
11
const fromString = utils . fromString
12
12
const fromNumberTo32BitBuf = utils . fromNumberTo32BitBuf
13
13
14
+ const dblSha2256 = ( buf , cb ) => {
15
+ sha . sha2256 ( buf , ( err , firstHash ) => {
16
+ if ( err ) {
17
+ cb ( err )
18
+ }
19
+ sha . sha2256 ( ( Buffer . from ( firstHash ) ) , cb )
20
+ } )
21
+ }
22
+
14
23
module . exports = {
15
24
sha1 : sha . sha1 ,
16
25
sha2256 : sha . sha2256 ,
@@ -27,5 +36,6 @@ module.exports = {
27
36
keccak512 : toCallback ( toBuf ( sha3 . keccak_512 ) ) ,
28
37
murmur3128 : toCallback ( toBuf ( fromString ( murmur3 . x64 . hash128 ) ) ) ,
29
38
murmur332 : toCallback ( fromNumberTo32BitBuf ( fromString ( murmur3 . x86 . hash32 ) ) ) ,
30
- addBlake : require ( './blake' )
39
+ addBlake : require ( './blake' ) ,
40
+ dblSha2256 : dblSha2256
31
41
}
Original file line number Diff line number Diff line change @@ -132,7 +132,9 @@ Multihashing.functions = {
132
132
// murmur3-128
133
133
0x22 : crypto . murmur3128 ,
134
134
// murmur3-32
135
- 0x23 : crypto . murmur332
135
+ 0x23 : crypto . murmur332 ,
136
+ // dbl-sha2-256
137
+ 0x56 : crypto . dblSha2256
136
138
}
137
139
138
140
// add blake functions
Original file line number Diff line number Diff line change @@ -72,4 +72,8 @@ module.exports = [[
72
72
'beep boop' ,
73
73
'blake2s-256' ,
74
74
'e0e402204542eaca484e4311def8af74b546edd7fceb49eeb3cdcfd8a4a72ed0dc81d4c0'
75
+ ] , [
76
+ 'beep boop' ,
77
+ 'dbl-sha2-256' ,
78
+ '56209cd9115d76945c2455b1450295b05f4edeba2e7286bc24c23e266b48faf578c0'
75
79
] ]
You can’t perform that action at this time.
0 commit comments