Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "bip32", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A BIP32 compatible library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -5,19 +5,16 @@ "use strict"; | ||
const createHmac = require('create-hmac'); | ||
let ripemd160; | ||
try { | ||
ripemd160 = require('crypto') | ||
.getHashes() | ||
.includes('rmd160') | ||
? 'rmd160' | ||
: 'ripemd160'; | ||
} | ||
catch (err) { | ||
ripemd160 = 'rmd160'; | ||
} | ||
function hash160(buffer) { | ||
return createHash(ripemd160) | ||
.update(createHash('sha256') | ||
const sha256Hash = createHash('sha256') | ||
.update(buffer) | ||
.digest()) | ||
.digest(); | ||
try { | ||
return createHash('rmd160') | ||
.update(sha256Hash) | ||
.digest(); | ||
} | ||
catch (err) { | ||
return createHash('ripemd160') | ||
.update(sha256Hash) | ||
.digest(); | ||
} | ||
} | ||
@@ -24,0 +21,0 @@ exports.hash160 = hash160; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16802
344