pmarches / jStellarAPI

java API for the stellar network
GNU Lesser General Public License v3.0
15 stars 3 forks source link

strip the s from seedaddress #17

Closed jargoman closed 10 years ago

jargoman commented 10 years ago

In the README it says RippleSeedAddress seed = new RippleSeedAddress("sXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

but I don't see anywhere in the code where the preceeding s is stripped from the seedaddress.

Shouldn't there be something along the lines of.. if (stringID = SEEDLENGTH + 1 && stringID[0] == 's') stripLeadingChar(stringID);

if (stringID.length!=SEEDLENGTH) throw exception("Invalid seed address length");

Great code by the way. I ported it to c#. I'll be testing my code soon :)

pmarches commented 10 years ago

Yes, that code is in RippleIdentifier.java at line 36. payloadBytes = Arrays.copyOfRange(stridBytes, 1, stridBytes.length-4);

You may also be interrested in https://ripple.com/wiki/Encodings

Cheers!

On Wed, Feb 5, 2014 at 11:38 AM, jargoman notifications@github.com wrote:

In the README it says RippleSeedAddress seed = new RippleSeedAddress("sXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

but I don't see anywhere in the code where the preceeding s is stripped from the seedaddress.

Shouldn't there be something along the lines of.. if (stringID = SEEDLENGTH + 1 && stringID[0] == 's') stripLeadingChar(stringID);

if (stringID.length!=SEEDLENGTH) throw exception("Invalid seed address length");

Great code by the way. I ported it to c#. I'll be testing my code soon :)

Reply to this email directly or view it on GitHubhttps://github.com/pmarches/jRippleAPI/issues/17 .

jargoman commented 10 years ago

Ohhh! The checksum includes the identifier byte. That explains why my checksums don't match