2014-02-24 04:06:54 -08:00
|
|
|
'use strict';
|
2014-02-17 23:49:35 -08:00
|
|
|
|
2014-02-24 04:06:54 -08:00
|
|
|
// Replace '..' with 'bitcore' if you plan on using this code elsewhere.
|
2014-02-17 23:49:35 -08:00
|
|
|
|
2014-03-05 11:18:44 -08:00
|
|
|
var Address = require('../Address');
|
2014-02-17 23:49:35 -08:00
|
|
|
|
|
|
|
var addrStrings = [
|
|
|
|
"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
|
|
|
|
"1A1zP1eP5QGefi2DMPTfTL5SLmv7Dixxxx",
|
|
|
|
"A1zP1eP5QGefi2DMPTfTL5SLmv7Dixxxx",
|
|
|
|
"1600 Pennsylvania Ave NW",
|
2014-02-24 04:06:54 -08:00
|
|
|
].map(function(addr) {
|
|
|
|
return new Address(addr);
|
|
|
|
});
|
2014-02-17 23:49:35 -08:00
|
|
|
|
2014-02-24 04:06:54 -08:00
|
|
|
addrStrings.forEach(function(addr) {
|
2014-02-17 23:49:35 -08:00
|
|
|
|
|
|
|
try {
|
|
|
|
addr.validate();
|
|
|
|
console.log(addr.data + ": is valid");
|
|
|
|
} catch(e) {
|
|
|
|
console.log(addr.data + ": is not a valid address. " + e);
|
|
|
|
}
|
2014-02-24 04:06:54 -08:00
|
|
|
|
2014-02-17 23:49:35 -08:00
|
|
|
});
|