TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

NUID – An entropy friendly and highly performant unique identifier generator

40 点作者 tylertreat超过 9 年前

6 条评论

tptacek超过 9 年前
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 未加载
heavenlyhash超过 9 年前
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 未加载
fweespeech超过 9 年前
&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 未加载
jamesrom超过 9 年前
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 未加载
NuSkooler超过 9 年前
What&#x27;s the use case here over a UUID?
评论 #11170160 未加载
nullc超过 9 年前
&quot;Entropy draining&quot; :(