2 ms·
1. UUIDs are stored somewhere so there's already O(n) space in use. Checking for collisions is only O(log n) in time. 2. Use a tree instead of a hash-table; o
by aidenn0 6y ago
1. UUIDs are stored somewhere so there's already O(n) space in use. Checking for collisions is only O(log n) in time.
2. Use a tree instead of a hash-table; or just use RDRAND and hope you aren't presented with malicious inputs.
The comment in the code[1] about RDRAND being sufficient for the use-case of UUIDs is empirically false. To continue to rely upon it is to insist that the rest of the world conform to your beliefs, rather than to adjust your beliefs to match the rest of the world.
1: https://github.com/systemd/systemd/blob/bcac754d66374782a85a8de39fd543c1eaf9fa82/src/basic/random-util.c#L40-L98 https://github.com/systemd/systemd/blob/bcac754d66374782a85a...
- tadfisher 6y ago> The comment in the code[1] about RDRAND being sufficient for the use-case of UUIDs is empirically false. Ipse dixit. Can you provide an explanation?
- aidenn0 6y ago1. TFA 2. https://arstechnica.com/gadgets/2019/10/how-a-months-old-amd-microcode-bug-destroyed-my-weekend/ https://arstechnica.com/gadgets/2019/10/how-a-months-old-amd... 3. https://linuxreviews.org/RDRAND_stops_returning_random_values_on_older_AMD_CPUs_after_suspend https://linuxreviews.org/RDRAND_stops_returning_random_value... 4. There are also comments elsewhere on this page that older Intel RDRAND implementations had similar issues, but they did not cite their source.