I’m looking at how best to generate reasonably short but unique id values (for something similar to a ‘membership number’ for a user).
I’ve been playing around with the hashids library, which has the attractive feature of avoiding profanity in the resulting id, and I quite like how it operates - I could store a salt as a secret in the app, if I wanted, for example.
However, it needs an integer to encode to produce the id. I could use an auto-incrementing integer field from a data table but, is there any reason I couldn’t use the result from get_id() on a data table record? I know it’s actually composed of strings, but are those always guaranteed to be string representations of integers?
Is there a completely different/better way to do this?