From 9e188574f70ee97a04c8bf1fe5d448aeb0e2278e Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Wed, 17 Sep 2014 14:43:14 -0700 Subject: [PATCH] base58check in extendedPrivateKeyString --- lib/bip32.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/bip32.js b/lib/bip32.js index a4e6876..e09d9f4 100644 --- a/lib/bip32.js +++ b/lib/bip32.js @@ -173,10 +173,7 @@ BIP32.prototype.buildExtendedPrivateKey = function() { BIP32.prototype.extendedPrivateKeyString = function(format) { if (format === undefined || format === 'base58') { - var hash = Hash.sha256sha256(this.extendedPrivateKey); - var checksum = hash.slice(0, 4); - var data = Buffer.concat([this.extendedPrivateKey, checksum]); - return base58.encode(data); + return Base58Check.encode(this.extendedPrivateKey); } else if (format === 'hex') { return this.extendedPrivateKey.toString('hex'); } else {