Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MosaicNonce uses inconsistent serialization/deserialization between byte[] and numbers #27

Open
tonowie opened this issue May 11, 2019 · 0 comments

Comments

@tonowie
Copy link
Contributor

tonowie commented May 11, 2019

MosaicNonce createFromBigInteger(BigInteger number) method uses little endian when converting big integer to byte array (nonce)

int getNonceAsInt() on the other hand uses big endian to convert byte array to int

this inconsistency creates confusing situation when making invocation like this
createFromBigInteger(BigInteger.ONE).getNonceAsInt()
One would expect this to return 1 but it does not because of the mismatch

@tonowie tonowie changed the title MosaicNonce uses inconsistent serialization/deserialization MosaicNonce uses inconsistent serialization/deserialization between byte[] and numbers May 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant