Re:Which hashing algorithm is best for uniqueness and speed?
by pbreit on Tuesday May 29, 2012 @01:04PM
(#4038473)
How do folks generally take an autoincrementing database ID and generate a hash to be used "in public" when trying to avoid revealing obviously serial numbers? I don't think I need something airtight, in fact in one system we just multiplied/divided by a 4 digit prime number. While this worked fine, it seemed a little loose.
[ Parent
| on HN ]
Re:Which hashing algorithm is best for uniqueness and speed?
by eli on Tuesday May 29, 2012 @01:37PM
(#4038676)
HASH(<id> + "static string pad") is how I imagine most people do it. Depends how much you care about a dedicated attacker figuring out that ID.
If this is a thing you're going to use a lot, I'd probably just add a database column and give each record a random unique "public ID" -- then there is literally no connection between the public ID and the private one..