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

Base58 Encoded string not being properly decoded #25

Open
MarcoDotIO opened this issue Sep 11, 2023 · 0 comments
Open

Base58 Encoded string not being properly decoded #25

MarcoDotIO opened this issue Sep 11, 2023 · 0 comments

Comments

@MarcoDotIO
Copy link

MarcoDotIO commented Sep 11, 2023

What is the issue:

When I go ahead and encode a value to Base58, everything works as intended (e.g., correct hash). However, when decoding, I receive the incorrect value. Here is the example:

let test = Base58.base58Encode([UInt8]([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))  // "1Bhh3pU9gLXZhoVxkr5wyg9sX6"
let test2 = Base58.base58Decode(test)  // [49, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Expected: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Received: [49, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

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