bitcore
bitcore copied to clipboard
'Address validation' example not working for me
Greetings,
I've installed bitcore using "$ npm install bitcore" and then I did "$ npm install classtool". I made a new file called "test.js" which I ran with "$ node test.js"
var Address = require('bitcore/Address').class();
var addr = new Address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");
try {
addr.validate();
console.log("Address is valid.");
} catch(e) {
console.log(addr.data + " is not a valid address. " + e);
}
Using this example... all I get is:
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa is not a valid address. RangeError: start > end
Is there anything I'm missing? I've been hours into this figuring out where is the problem...
From @unlmtd comment's on https://github.com/bitpay/bitcore/issues/93 I assume this is solved. If not, please let me know and we'll reopen the issue.