News for hackers. Stuff that matters.
Re:Moving Away from UUIDs by withinboredom on Monday November 21, 2022 @07:10PM (#33700044)
I think v7 uses microseconds since epoch + random data. The odds of a collision should be practically 0, or more likely to find a sha256 collision.
Re:Moving Away from UUIDs by morelisp on Tuesday November 22, 2022 @02:36AM (#33703109)
> more likely to find a sha256 collision.

This is obviously, and egregiously, false.

Re:Moving Away from UUIDs by withinboredom on Tuesday November 22, 2022 @02:43AM (#33703149)
I don't know. You'd need quite a number of threads + machines generating uuids in the exact same microsecond to get an opportunity for a collision. It doesn't seem obviously false.
Re:Moving Away from UUIDs by morelisp on Tuesday November 22, 2022 @07:27AM (#33705018)
I didn't say a collision is easy, I said it's obviously false it's harder than colliding a sha256, a space roughly 95780971304118053647396689196894323976171195136475136 times larger.
Re:Moving Away from UUIDs by withinboredom on Tuesday November 22, 2022 @01:29PM (#33709141)
It /can/ be smaller though, as the probability is linked to the number of global threads generating UUIDs in any given microsecond. Thus if you have enough machines generating UUIDs, you'll have more chances for a collision. Given that it is only possible to generate a collision in a given microsecond, and not globally across ALL TIME, over ∞ time, the probability of a collision(UUID) == 0, while a collision(sha256) == 100%.
Re:Moving Away from UUIDs by morelisp on Tuesday November 22, 2022 @01:36PM (#33709253)
Your counter rolls eventually. You're underappreciating how much larger 2^256 is than 2^80 or even 2^128.