top | item 46611249

(no title)

haileys | 1 month ago

This is well understood - Hyrum's law.

You don't need encryption, a global_id database column with a randomly generated ID will do.

discuss

order

maxbond|1 month ago

You could but you would lose the performance benefits you were seeking by encoding information into the ID. But you could also use a randomized, proprietary base64 alphabet rather than properly encrypting the ID.

pdpi|1 month ago

XOR encryption is cheap and effective. Make the key the static string "IfYouCanReadThisYourCodeWillBreak" or something akin to that. That way, the key itself will serve as a final warning when (not if) the key gets cracked.

haileys|1 month ago

Encoding a type name into an ID is never really something I've viewed as being about performance. Think of it more like an area code, it's an essential part of the identifier that tells you how to interpret the rest of it.