bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

'Address validation' example not working for me

Open IvanMontilla opened this issue 12 years ago • 1 comments

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...

IvanMontilla avatar Feb 24 '14 22:02 IvanMontilla

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.

maraoz avatar Feb 26 '14 22:02 maraoz