4 ms·
This is often dealt with trivially using collision-free hashing. It exports a number in the same domain as the sequence (i.e. 64-bit sequence -> 64-bit id) but
by jandrewrogers 5y ago
This is often dealt with trivially using collision-free hashing. It exports a number in the same domain as the sequence (i.e. 64-bit sequence -> 64-bit id) but is not reversible and is guaranteed to be unique.
- leetrout 5y agoI was not aware of this! Do you have a favorite link for more information on this?
- noodlesUK 5y agoThis is true with identifiers which are already random, but unless you’re doing something like keyed hashing, a naive implementation of say SHA256(predictable_id) isn’t going to solve this problem against a determined attacker, but I’d like to learn a bit more about what you’re discussing here.
- jandrewrogers 5y agoFor example, running the sequence generator through AES rounds. This is keyed, very fast if the hardware supports it, and permutations of types smaller than the block size are collision-free and non-reversible[0] if the AES block is setup suitably. In other cases, a 128-bit key is simply encrypted (conveniently being the same block size as AES), which allows you to put arbitrary structure inside the exported key. [0] http://www.jandrewrogers.com/2019/02/12/fast-perfect-hashing/ http://www.jandrewrogers.com/2019/02/12/fast-perfect-hashing...