fix bufferify function
This commit is contained in:
parent
cd0eb7506a
commit
b83a1e1189
|
@ -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);
|
||||
|
|
2
index.ts
2
index.ts
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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/*",
|
||||
|
|
Loading…
Reference in New Issue