Browse Source
Merge pull request #1373 from RyanZim/patch-1
Change rmd160 -> ripemd160 for Electron v4
v4
Jonathan Underwood
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
16 additions and
5 deletions
-
package-lock.json
-
package.json
-
src/crypto.js
|
@ -148,9 +148,9 @@ |
|
|
"integrity": "sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew==" |
|
|
"integrity": "sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew==" |
|
|
}, |
|
|
}, |
|
|
"bip32": { |
|
|
"bip32": { |
|
|
"version": "1.0.2", |
|
|
"version": "1.0.3", |
|
|
"resolved": "https://registry.npmjs.org/bip32/-/bip32-1.0.2.tgz", |
|
|
"resolved": "https://registry.npmjs.org/bip32/-/bip32-1.0.3.tgz", |
|
|
"integrity": "sha512-kedLYj8yvYzND+EfzeoMSlGiN7ImiRBF/MClJSZPkMfcU+OQO7ZpL5L/Yg+TunebBZIHhunstiQF//KLKSF5rg==", |
|
|
"integrity": "sha512-rY7ie/4Nmcpgx1y4kAsJJLiluGzNzz20u44LFaElLXCGq3hQjfHV11r9fHwbtquKZ4JXL7BEMCnmpCzFko4ZLA==", |
|
|
"requires": { |
|
|
"requires": { |
|
|
"bs58check": "^2.1.1", |
|
|
"bs58check": "^2.1.1", |
|
|
"create-hash": "^1.2.0", |
|
|
"create-hash": "^1.2.0", |
|
|
|
@ -31,7 +31,7 @@ |
|
|
], |
|
|
], |
|
|
"dependencies": { |
|
|
"dependencies": { |
|
|
"bech32": "^1.1.2", |
|
|
"bech32": "^1.1.2", |
|
|
"bip32": "^1.0.0", |
|
|
"bip32": "^1.0.3", |
|
|
"bip66": "^1.1.0", |
|
|
"bip66": "^1.1.0", |
|
|
"bitcoin-ops": "^1.4.0", |
|
|
"bitcoin-ops": "^1.4.0", |
|
|
"bs58check": "^2.0.0", |
|
|
"bs58check": "^2.0.0", |
|
|
|
@ -1,7 +1,18 @@ |
|
|
const createHash = require('create-hash') |
|
|
const createHash = require('create-hash') |
|
|
|
|
|
|
|
|
|
|
|
let rmd160 |
|
|
|
|
|
try { |
|
|
|
|
|
rmd160 = require('crypto') |
|
|
|
|
|
.getHashes() |
|
|
|
|
|
.includes('rmd160') |
|
|
|
|
|
? 'rmd160' |
|
|
|
|
|
: 'ripemd160' |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
rmd160 = 'rmd160' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function ripemd160 (buffer) { |
|
|
function ripemd160 (buffer) { |
|
|
return createHash('rmd160').update(buffer).digest() |
|
|
return createHash(rmd160).update(buffer).digest() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function sha1 (buffer) { |
|
|
function sha1 (buffer) { |
|
|