TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

NUID – An entropy friendly and highly performant unique identifier generator

40 pointsby tylertreatabout 9 years ago

6 comments

tptacekabout 9 years ago
There is no such thing as &quot;entropy draining&quot;.<p>If it&#x27;s higher-performance than other UUID generators, fine, that&#x27;s a win. But it&#x27;s not doing anything useful for the system as a whole by sparing the &quot;entropy pool&quot;.
评论 #11171011 未加载
heavenlyhashabout 9 years ago
I wrote Yet Another UUID [1] for my own purposes recently as well. Mine&#x27;s based on Firebase&#x27;s style UIDs [2] -- they sort roughly chronologically, because operationally, I find that irritates me less. Arbitrary choice? Entirely. Regrets? None. Do I recommend it for use? Also not at all. Unless you feel like it. It&#x27;s fine. I guess.<p>I&#x27;ve kind of given up on there being any purpose to a One True Spec for UUIDs. Count how many bits of entropy you want. Shove some CSPRNG into it. Call it a day.<p>¯\_(ツ)_&#x2F;¯<p>(This a fine implementation, fwiw. I only mean to share my honest question as to whether there&#x27;s any real utility to UUIDs-as-a-library.)<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;polydawn&#x2F;repeatr&#x2F;blob&#x2F;dd41ca72421a173b5aa14580f5d7df48df1548d0&#x2F;lib&#x2F;guid&#x2F;guid.go" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;polydawn&#x2F;repeatr&#x2F;blob&#x2F;dd41ca72421a173b5aa...</a> [2] <a href="https:&#x2F;&#x2F;www.firebase.com&#x2F;blog&#x2F;2015-02-11-firebase-unique-identifiers.html" rel="nofollow">https:&#x2F;&#x2F;www.firebase.com&#x2F;blog&#x2F;2015-02-11-firebase-unique-ide...</a>
评论 #11171949 未加载
fweespeechabout 9 years ago
&gt; 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.<p>&gt; Total length of a NUID string is 22 bytes of base 36 ascii text, so 36^22 or 17324272922341479351919144385642496 possibilities.<p>Isn&#x27;t 22 bytes = 176 bits?<p>UUID = 128 bit<p>Storage performance is more than per-ns on a CPU core, imo.
评论 #11170952 未加载
评论 #11170631 未加载
jamesromabout 9 years ago
Why on earth would you care about entropy for a UUID?<p>You can use the most basic PRNG to generate your 128 bits. There&#x27;s your UUID.<p>Call me when you find a collision.
评论 #11171442 未加载
NuSkoolerabout 9 years ago
What&#x27;s the use case here over a UUID?
评论 #11170160 未加载
nullcabout 9 years ago
&quot;Entropy draining&quot; :(