Fix error for lack of rmd160 in Electron v4
This commit is contained in:
parent
d4dc26fb33
commit
335ed99a1c
2 changed files with 19 additions and 6 deletions
|
@ -2,10 +2,17 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const createHash = require('create-hash');
|
||||
function ripemd160(buffer) {
|
||||
try {
|
||||
return createHash('rmd160')
|
||||
.update(buffer)
|
||||
.digest();
|
||||
}
|
||||
catch (err) {
|
||||
return createHash('ripemd160')
|
||||
.update(buffer)
|
||||
.digest();
|
||||
}
|
||||
}
|
||||
exports.ripemd160 = ripemd160;
|
||||
function sha1(buffer) {
|
||||
return createHash('sha1')
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
const createHash = require('create-hash');
|
||||
|
||||
export function ripemd160(buffer: Buffer): Buffer {
|
||||
try {
|
||||
return createHash('rmd160')
|
||||
.update(buffer)
|
||||
.digest();
|
||||
} catch (err) {
|
||||
return createHash('ripemd160')
|
||||
.update(buffer)
|
||||
.digest();
|
||||
}
|
||||
}
|
||||
|
||||
export function sha1(buffer: Buffer): Buffer {
|
||||
|
|
Loading…
Reference in a new issue