Skip to content

When creating a hash from DateTime.UtcNow.Ticks an exception occurs #1

@tekiegirl

Description

@tekiegirl

Is Ticks too big a number, or is there another problem? Changing the min length doesn't seem to make a difference. Many thanks for looking at this.

Ticks example: 635343802323744811

var h = new Hashids("foo", 5);
return start + h.Encrypt(DateTime.UtcNow.Ticks);
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.String.get_Chars(Int32 index)
   at HashidsNet.Hashids.Hash(Int64 input, String alphabet) in [where dll stored]\Hashids\hashids.net-master\Hashids.net\Hashids.cs:line 180
   at HashidsNet.Hashids.Encrypt(Int64[] input) in [where dll stored]\Hashids\hashids.net-master\Hashids.net\Hashids.cs:line 100
   at myProject.Controllers.BaseController.myMethod(String start, String salt, Int32 minLength) in [where project stored]\myProject\Controllers\BaseController.cs:line 34}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions