merge weilu's changes

This commit is contained in:
Kyle Drake 2014-03-06 17:21:42 -06:00
parent 2f3e597596
commit fdc78dad2e
No known key found for this signature in database
GPG key ID: 8BE721072E1864BE
2 changed files with 49 additions and 16 deletions

View file

@ -14,7 +14,7 @@ var Address = function (bytes, version) {
this.hash =
bytes.length <= 35 ? base58.checkDecode(bytes)
: bytes.length <= 40 ? conv.hexToBytes(bytes)
: util.error('Bad input');
: util.error('invalid or unrecognized input');
this.version = version || this.hash.version || mainnet;
}
@ -33,10 +33,6 @@ Address.prototype.toString = function () {
return base58.checkEncode(this.hash.slice(0), this.version);
};
Address.prototype.getHash = function () {
return conv.bytesToHex(this.hash);
};
Address.getVersion = function(string) {
return base58.decode(string)[0];
}
@ -50,11 +46,4 @@ Address.validate = function(string) {
}
};
/**
* Parse a Bitcoin address contained in a string.
*/
Address.decodeString = function (string) {
return base58.checkDecode(string);
};
module.exports = Address;