Functions for working with altcoin addresses, forked from DefunctZombie.
returns true if the address (string) is a valid altcoin address for the type specified
if no options are specified it defaults to bitcoin
returns address type if valid base58 address, otherwise null
I intend to update this to include more currencies in the future. If you would like a new currency added quickly please send a pull request including tests.
This will work for both BIP-0016 P2SH addresses and regular addresses.
To check the validity of a testnet address for any of the listed coins just append 'Testnet'
var altcoin = ;var valid = altcoin;ifvalidconsole;elseconsole;//This should return that 'This is a valid address'
var altcoin = ;var valid = altcoin;ifvalidconsole;elseconsole;//As this is a invalid litecoin address response will be 'Address INVALID'
If you've found this useful feel free to send me a tip