4 ms·
gen_random_uuid() produces a v4 UUID. Taking the first 5 bytes of a v6 UUID (time) and last 5 (node) would be a bad random day.
by mhio 2y ago
gen_random_uuid() produces a v4 UUID.
Taking the first 5 bytes of a v6 UUID (time) and last 5 (node) would be a bad random day.
- manwe150 2y agoWait, is this blog actually about how to introduce a backdoor into your Postgres install by rolling your own very bad rng?
- fanf2 2y agoNo, a v4 uuid comes from a good RNG. The blog post just said v6 by mistake when it meant v4.
- thadt 2y agoNah, mhio is saying that the blog post has a typo: > Postgres 13’s gen_random_uuid() which generates a V6 UUID that’s secure... gen_random_uuid gives you a version V4 UUID, not a V6 UUID (it's even in the code comments in the snipped included in the blog). I don't believe Postgres even has a function to generate a V6 UUID - which, indeed, would be a bad idea to use as a source of randomness.
- hinkley 2y agoI read this exact reply on this exact article two days ago. What is happening right now?
- tom_ 2y agoTake the blue pill, press the back button, and pretend you never saw it. Or take the red pill, pull back the curtains of reality, and see the machinery behind: https://news.ycombinator.com/item?id=41197775 https://news.ycombinator.com/item?id=41197775
- hinkley 2y agoAnd I got two replies recorded after making an edit to expand on my question. Glitch in the matrix.
- frutiger 2y agoMy HN client uses the HN API which reveals the true post time of the comment. See https://seville.protostome.com/item/?id=41641314 https://seville.protostome.com/item/?id=41641314.
- hinkley 2y agoI read this exact reply on this exact article two days ago. What is happening right now? Why is your comment marked four hours ago?