Skip to content

Base58 Encoded string not being properly decoded #25

@MarcoDotIO

Description

@MarcoDotIO

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions