Make the version byte a parameter.

This commit is contained in:
Stefan Thomas 2011-05-08 11:48:54 +01:00
parent 11eb59873e
commit a4de03af4d

View file

@ -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});