3 ms·
Will the ulid be unique even if it is generated from 2 different machines at the same millisecond?
by pritambarhate 10y ago
Will the ulid be unique even if it is generated from 2 different machines at the same millisecond?
- tsenart 10y agoYes 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!
- drfuchs 10y agoYes, if your source of entropy is worth its salt.
- vlowther 10y agoThat was bad and you should feel bad. :)