Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
rollulus
4 months ago
|
parent
|
context
|
favorite
| on:
UUID package coming to Go standard library
Well that depends on your luck, it could be a valid one about 1/16th of the time.
jasomill
4 months ago
[–]
1/64, actually, because RFC-compliant (variant 1) UUIDv4 requires fixed values for both the version nibble and two bits of the variant nibble.
The fact that we're discussing this at all is a reasonable argument for using a library function.
3eb7988a1663
4 months ago
|
parent
|
next
[–]
While it might be invalid, will most libraries choke if you give them a pseudo UUIDv4?
efilife
4 months ago
|
root
|
parent
|
next
[–]
What do you mean? Are you talking about validation of UUIDs?
3eb7988a1663
4 months ago
|
root
|
parent
|
next
[–]
If you generate random bytes, which are unlikely to conform to the UUIDv4 spec, my guess is that most libraries will silently accept the id. That is, generating random bytes, will probably work just work.
efilife
4 months ago
|
root
|
parent
|
next
[–]
But what libraries are you talking about? What is their purpose?
rollulus
4 months ago
|
parent
|
prev
[–]
Nice, thanks and I agree.
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: