News for hackers. Stuff that matters.
Re:Universally Unique Lexicographically Sortable Identifier ... by tsenart on Tuesday December 06, 2016 @01:01PM (#13116746)
Yes if you use a good source of entropy. In Go, the easiest and most secure is the `crypto/rand.Reader`. But it's also slow. If you don't need the security properties, an instance of `math/rand.Rand` should suffice. Otherwise, you can implement your own. It's just an io.Reader!
Re:Universally Unique Lexicographically Sortable Identifier ... by Freak_NL on Tuesday December 06, 2016 @03:57PM (#13118274)
Doesn't that mean that it will usually — but not guaranteed always — be unique? That is, won't there always be a (minute and negligible depending on the intended use) chance of collision?
Re:Universally Unique Lexicographically Sortable Identifier ... by tsenart on Tuesday December 06, 2016 @05:17PM (#13118789)
Yes, there's always a negligible chance of collision.