Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
junon
on July 21, 2023
|
parent
|
context
|
favorite
| on:
Nanosecond timestamp collisions are common
Don't even need the "same millisecond" part to save a few cycles, use case depending. An overflowing increment with a counter of any sort plus a few random bits is usually enough.
If you're clever enough, neither needs a branch.
SV_BubbleTime
on July 21, 2023
[–]
UUIDv7 has two at least two such monotonic strategies. You can use a counter, or you can use those bytes to increase the random entropy.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
If you're clever enough, neither needs a branch.