I wonder if there is a Java implementation of Monero addresses validation code somewhere?
I've found this JS implementation which seems to work well:
https://github.com/ognus/wallet-address-validator/blob/master/src/monero_validator.js
and, an online version:
https://xmr.llcoins.net/addresstests.html
But I've been unable to make a Java port of this code. As soon as I try ot decode the address to a byte[], using tools such as this one, I get a different array than the one from the JS lib.
For example, this Monero test address: "46oTQPpoxoxQ6XGWwPqEK1YvADH8X91rFC6brLWRHokoAC5qwbYKA2e9jzQyapENw4V2w5Tz1d4LiMSuDhhFCCf77mQgLRA"
The JS lib decodes it to (as an Hex string):
1288a647369f2eff8a13c3b9bc9d1448bed1046d431ec4a842578fcee2d49ec436f3310b57e0b12334429fb90e70304ba799a9ee799536a37a3df25dfd3e96c63bf7c2c4ad
When I try to do the samething in Java using:
byte[] decoded = Base58.decode(address);
String decodedStr = org.apache.commons.codec.binary.Hex.encodeHexString(decoded);
I get:
01375ee6692c3cc848c015498b3ae7660520580d15f8fc6c18ab92b68776e06658820d977b26913464b48a6d2961e95bb366d14fa19775482b7accecdb2f6b0c3c2565c1a3ad
Any idea?