Skip to content

Attempting to Decode short strings results in incorrect exceptions being produced #75

@crmeadowcroft

Description

@crmeadowcroft

1 character length strings produce:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at HashidsNet.Hashids.GenerateHashFrom(Int64 number, Span`1& result)
at HashidsNet.Hashids.GetNumberFrom(String hash)
at HashidsNet.Hashids.DecodeSingle(String hash)

2 character length strings produce:
System.ArgumentException: Destination is too short. (Parameter 'destination')
at HashidsNet.Hashids.GenerateHashFrom(Int64 number, Span`1& result)
at HashidsNet.Hashids.GetNumberFrom(String hash)
at HashidsNet.Hashids.DecodeSingle(String hash)

for any "hash" strings of 1 or 2 character length. NoResultException should be produced in these cases.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions