From a4de03af4d9148052c259459fd9b3863d8355dfc Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Sun, 8 May 2011 11:48:54 +0100 Subject: [PATCH] Make the version byte a parameter. --- address.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/address.js b/address.js index ed38d79..8e99694 100644 --- a/address.js +++ b/address.js @@ -3,6 +3,8 @@ Bitcoin.Address = function (bytes) { bytes = Bitcoin.Address.decodeString(bytes); } this.hash = bytes; + + this.version = 0x00; }; Bitcoin.Address.prototype.toString = function () { @@ -10,7 +12,7 @@ Bitcoin.Address.prototype.toString = function () { var hash = this.hash.slice(0); // Version - hash.unshift(0x00); + hash.unshift(this.version); var checksum = Crypto.SHA256(Crypto.SHA256(hash, {asBytes: true}), {asBytes: true});