News for hackers. Stuff that matters.
Re:UUID package coming to Go standard library by rollulus on Saturday March 07, 2026 @02:40AM (#47285408)
Well that depends on your luck, it could be a valid one about 1/16th of the time.
Re:UUID package coming to Go standard library by jasomill on Saturday March 07, 2026 @05:47AM (#47286405)
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.

Re:UUID package coming to Go standard library by rollulus on Saturday March 07, 2026 @11:17AM (#47288935)
Nice, thanks and I agree.
Re:UUID package coming to Go standard library by 3eb7988a1663 on Saturday March 07, 2026 @11:19AM (#47288954)
While it might be invalid, will most libraries choke if you give them a pseudo UUIDv4?
Re:UUID package coming to Go standard library by efilife on Sunday March 08, 2026 @08:01AM (#47296646)
What do you mean? Are you talking about validation of UUIDs?
Re:UUID package coming to Go standard library by 3eb7988a1663 on Sunday March 08, 2026 @12:06PM (#47298407)
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.
Re:UUID package coming to Go standard library by efilife on Sunday March 08, 2026 @12:39PM (#47298692)
But what libraries are you talking about? What is their purpose?