hashids.github.io icon indicating copy to clipboard operation
hashids.github.io copied to clipboard

Comparing hashids for sorting?

Open phaddius opened this issue 6 years ago • 1 comments

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.

phaddius avatar Mar 17 '18 07:03 phaddius

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

With salt = "a":

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

kevinresol avatar Mar 17 '18 13:03 kevinresol

Closing since the project is moving.

4kimov avatar Jul 27 '23 14:07 4kimov