Skip to content

Incorrect value when decoding hex #14

@valantonini

Description

@valantonini

Hi,

It looks like the hex decoding isn't working. I tried the example on the project page and it is losing the first character:

    var hashids = new Hashids("this is my salt");
    var hash = hashids.EncodeHex("DEADBEEF");  //kRNrpKlJ
    var decoded = hashids.DecodeHex(hash);  //EADBEEF
    hashids.DecodeHex("kRNrpKlJ");  //EADBEEF

On longer hex values it is missing more characters:

    var hashids = new Hashids("this is my salt");
    var hash = hashids.EncodeHex("1234567890ABCDEF"); //57DeZ32Xq1t7X5y
    var decoded = hashids.DecodeHex(hash); //67890ABCDEF

Thanks,

Val

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