fix bufferify function

This commit is contained in:
Miguel Mota 2019-06-16 16:47:38 -07:00
parent cd0eb7506a
commit b83a1e1189
No known key found for this signature in database
GPG Key ID: 67EC1161588A00F9
3 changed files with 3 additions and 3 deletions

2
dist/index.js vendored
View File

@ -327,7 +327,7 @@ function bufferify(x) {
return Buffer.from(x.toString(CryptoJS.enc.Hex), 'hex');
}
else if (isHexStr(x)) {
return Buffer.from(x, 'hex');
return Buffer.from(x.replace(/^0x/, ''), 'hex');
}
else if (typeof x === 'string') {
return Buffer.from(x);

View File

@ -395,7 +395,7 @@ function bufferify(x) {
if (typeof x === 'object' && x.words) {
return Buffer.from(x.toString(CryptoJS.enc.Hex), 'hex')
} else if (isHexStr(x)) {
return Buffer.from(x, 'hex')
return Buffer.from(x.replace(/^0x/, ''), 'hex')
} else if (typeof x === 'string') {
return Buffer.from(x)
}

View File

@ -1,6 +1,6 @@
{
"name": "merkletreejs",
"version": "0.1.3",
"version": "0.1.4",
"description": "Construct Merkle Trees and verify proofs",
"main": "dist/index.js",
"types": "typings/merkletreejs/*",