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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Tifuhash - Tiny Fast Universal Hash, using 64-bit continued fractions

42 点作者 19eightyfour将近 8 年前

6 条评论

dchest将近 8 年前
<p><pre><code> &gt; t.hash(0.00000000000000001) &#x27;0000000000000000&#x27; &gt; t.hash(0.00000000000000002) &#x27;00000000ffffffff&#x27; &gt; t.hash(0.00000000000000003) &#x27;00000000ffffffff&#x27; &gt; t.hash(0.00000000000000004) &#x27;00000000ffffffff&#x27; &gt; t.hash(0.00000000000000005) &#x27;00000000fdffffff&#x27; &gt; 0.00000000000000001 &gt; t.hash(1e17) &#x27;5555555597d44646&#x27; &gt; t.hash(1e18) &#x27;55555555ac43d2d1&#x27; &gt; t.hash(1e19) &#x27;55555555acd2b64f&#x27; &gt; t.hash(&#x27;\000&#x27;) &#x27;0000000000000000&#x27; &gt; t.hash(&#x27;\000\000&#x27;) &#x27;5555555592244992&#x27; &gt; t.hash(&#x27;\000\000\000&#x27;) &#x27;0000000000000000&#x27; &gt; t.hash(&#x27;\001&#x27;) &#x27;9224499200000000&#x27; &gt; t.hash(&#x27;\002&#x27;) &#x27;33333333dedddddd&#x27;</code></pre>
评论 #14519684 未加载
评论 #14519654 未加载
评论 #14519646 未加载
评论 #14519671 未加载
lorenzhs将近 8 年前
In addition to the things others have pointed out, note that &quot;universality&quot; is a well-defined concept w.r.t. hash functions: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Universal_hashing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Universal_hashing</a> - you should probably not use it to describe your hash function if you can&#x27;t show universality.
评论 #14522317 未加载
评论 #14520140 未加载
rjeli将近 8 年前
Sorry, I can only read this as &quot;Today I Fucked Up hash&quot;
评论 #14519777 未加载
评论 #14519552 未加载
评论 #14521315 未加载
richdougherty将近 8 年前
&gt; Novel: using division, or using floating point division, and discarding the high-order-bits ( as we do here ) is not used nor studied so much, if at all, in hash construction<p>Is that because division is slow compared to bit operations?
评论 #14523102 未加载
johnklos将近 8 年前
&quot;Uses two 64 bit floating point integers for calculation&quot;? Floating point integers?
评论 #14519705 未加载
评论 #14519709 未加载
评论 #14519703 未加载
davman将近 8 年前
This is connected with a truly amazing website that does not make my eyes bleed in any way.<p><a href="https:&#x2F;&#x2F;dosaygo.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dosaygo.com&#x2F;</a>
评论 #14520282 未加载
评论 #14521569 未加载
评论 #14519898 未加载