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

Limit length of hash?

Open toomanyjoes opened this issue 4 years ago • 1 comments

Is there a way to limit the length of the hash to a certain number of character?

toomanyjoes avatar Sep 17 '21 23:09 toomanyjoes

You would need to limit the number(s) used to generate the hash.

If you're only using 1 number to generated the hash, make a loop, and stop it once the number is more than the limit, and you have your max value.

miquelfire avatar Sep 18 '21 00:09 miquelfire

There's no way to set the max length (only min). It's not a hash, but an id. Since they're generated by encoding numbers, sooner or later you'll overflow any length.

4kimov avatar Jun 15 '23 16:06 4kimov