hashids / hashids.github.io

This is the old Hashids website. It is no longer maintained and has migrated over to Sqids.
https://sqids.org
206 stars 34 forks source link

Comparing hashids for sorting? #43

Closed phaddius closed 1 year ago

phaddius commented 6 years ago

This may be a dumb question, but can hashids be sorted and compared alphanumerically?

If x < y, is hashid(x) < hashid(y) alphanumerically?

This would be useful to know in order to sort a list of objects based on their creation order using only their hashids.

kevinresol commented 6 years ago

I think you can answer yourself with a simple experiment similar to this:

With salt = "a":

1 => RD 2 => 6P 3 => aE

4kimov commented 1 year ago

Closing since the project is moving.