除了生成哈希码字符串的替代方案之外,Google 的 CityHash 还有什么用处?
Google 最近发布了 http://code.google.com/p/cityhash/。它是 MurmurHash 的一个变体, http://sites.google.com/site/murmurhash/
正如提到的那样不能用于密码学,其中使用它作为现有哈希的替代品的所有可能有趣的情况?
寻找可以使用此哈希实现的算法,类似于 http://www.partow.net/programming/哈希函数/
Google has released http://code.google.com/p/cityhash/ recently. It is a variant of MurmurHash,
http://sites.google.com/site/murmurhash/
As it is mentioned that it can't be used for cryptography, in which all possible interesting cases for using it as an alternative for existing hash?
Looking for algorithms that can use this hash implementation, similar to http://www.partow.net/programming/hashfunctions/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MurmurHash(以及扩展的 CityHash)被设计为通用的、非安全的哈希值。它们最常见的用途是作为哈希表中的键 - 但也有其他应用程序,例如 Bloom Filters,也存在。
此类哈希的主要标准是它们生成速度快,但分布良好,以避免哈希表等中的热点。第一部分排除了较慢的安全散列函数,第二部分(避免热点)排除了大多数琐碎的函数,例如将字节求和或异或在一起,这使得设计快速但分布均匀的散列非常具有挑战性。
MurmurHash (and by extension, CityHash) are designed as general-purpose, non-secure hashes. The most common use for them is as a key in a hashtable - but other applications, such as Bloom Filters, also exist.
The main criteria for such hashes is that they be fast to generate, yet well distributed, to avoid hotspots in hashtables and the like. The first part rules out slower secure hashing functions, and the second (avoiding hotspots) rules out most trivial functions such as summing or xoring bytes together, which makes the design of a fast but well-distributed hash quite challenging.