Skip to content

Bug on long encoding with 16 alphabet chars #64

@GihanSoft

Description

@GihanSoft

below code throw System.IndexOutOfRangeException

var hashids = new Hashids("salt", alphabet:"0123456789ABCDEF");
var hash = hashids.EncodeLong(long.MaxValue);

full exception text:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at HashidsNet.Hashids.BuildReversedHash(Int64 input, Char[] alphabet, Char[] hashBuffer)
   at HashidsNet.Hashids.GenerateHashFrom(Int64[] numbers)
   at HashidsNet.Hashids.EncodeLong(Int64[] numbers)
   at Program.<<Initialize>>d__0.MoveNext() in :line 7

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