5 ms·
> NUID needs to be very fast to generate and be truly unique, all while being entropy pool friendly. NUID uses 12 bytes of crypto generated data (entropy draini
by fweespeech 11y ago
> NUID needs to be very fast to generate and be truly unique, all while being entropy pool friendly. NUID uses 12 bytes of crypto generated data (entropy draining), and 10 bytes of pseudo-random sequential data that increments with a pseudo-random increment.
> Total length of a NUID string is 22 bytes of base 36 ascii text, so 36^22 or 17324272922341479351919144385642496 possibilities.
Isn't 22 bytes = 176 bits?
UUID = 128 bit
Storage performance is more than per-ns on a CPU core, imo.
- sheng 11y agoUUIDs are 120 Bit or less. Depending on the Version you use. But you lose 8 bit on any version because 1 byte is used to decode the UUID version.
- fweespeech 11y agoYes. 128bit is the worst case for UUIDs, I was trying to avoid the claim I was being overly generous by using the smallest size I could get away with. ;)
- JoeAltmaier 11y agoHm. The RFC says 4 bits + 2 bits (variant and variant version) are taken. That leaves 122 bits?
- derekcollison 11y agoYes, but most UUID when moved across networks are translated to hex, so 32 bytes/characters whereas NUID's are 22 bytes, so generally a savings of 10 bytes per when stored as a string.
- deleted 11y ago[deleted]