Closed iamsajidjaved closed 5 years ago
I would not recommend to save Hashids in the database.
I would suggest you to take a look at UUID instead: ramsey/uuid
@vinkla I was planning to use HashId to obfuscate the primary key as well (in URL for instance). I would not store the hash in the DB but would transform them on the fly when necessary. Are you saying this is the wrong approach? Using uuid would work but it does not generate friendly url...
...would transform them on the fly when necessary. Are you saying this is the wrong approach?
In your case I would suggest using Hashids.
Hello,
I want to generate a unique random hash for each table record. My requirement is each hash must be unique in the table and will represent a specific record. I don't want to expose my primary keys.
How I generate unique random hashes? I always encode the primary id of my table and as you know the primary key is unique and represent a specific record in a table. So, my input is unique.
My question is, I will get a unique output or not if I pass a unique input?