寻找一个快速的散列函数 [英] Looking for a fast hash-function

查看:93
本文介绍了寻找一个快速的散列函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个特殊的散列函数。假设我有大量的字符串,如果我通过它们的散列值对它们进行排序,它们应该是准随机排序的。

最重要的一点是:它必须超快。我已经尝试过md5和sha1,并且它们使用了很多CPU功能。



冲突不是问题。



我使用的是javascript,所以它不应该太复杂。



http://sites.google.com/site/murmurhash/


I'm looking for a special hash-function. Let's say I have a large list of strings, if I order them by their hash-values they should be ordered quasi randomly.

The most important point is: it must be super fast. I've tried md5 and sha1 and they're using to much cpu power.

Clashes are not a problem.

I'm using javascript, so it shouldn't be too complicated to implement.

解决方案

Take a look at Murmur hash. It has a nice space/collision trade-off:

http://sites.google.com/site/murmurhash/

这篇关于寻找一个快速的散列函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆