|
|
@ -215,10 +215,13 @@ BIP32.prototype.derive = function(path) { |
|
|
|
var c = e[i]; |
|
|
|
|
|
|
|
if (i == 0) { |
|
|
|
if (c != 'm') throw new Error('invalid path'); |
|
|
|
if (c != 'm') throw new Error('bip32: invalid path'); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
if (parseInt(c.replace("'", "")).toString() !== c.replace("'", "")) |
|
|
|
throw new Error('bip32: invalid path'); |
|
|
|
|
|
|
|
var usePrivate = (c.length > 1) && (c[c.length - 1] == '\''); |
|
|
|
var childIndex = parseInt(usePrivate ? c.slice(0, c.length - 1) : c) & 0x7fffffff; |
|
|
|
|
|
|
|