请解释一下杂音哈希? [英] Please explain murmur hash?

查看:179
本文介绍了请解释一下杂音哈希?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现杂音哈希,似乎是目前最快的,相当抗碰撞性。我试图挖掘更多关于完整的源$ C ​​$ c中的算法或实现,但我有困难的理解它。可能有人解释这里所使用的算法,或完整的源$ C ​​$ C实现它,preferably在C.我读从作者网站的C源$ C ​​$ C,但不知道,这样的:什么是种子, H,K,米? 这是什么意思:

I just found out murmur hash, seems to be the fastest known and quite collision resistance. I tried to dig more about the algorithm or implementation in full source code, but I am having difficulty understanding it. Could someone here explain the algorithm used, or implement it in full source code, preferably in C. I read the C source code from the author website but has no idea, like: what is seed, h, k, m ? what does this mean :

k *= m; 
k ^= k >> r; 
k *= m; 

h *= m; 
h ^= k;

data += 4;
len -= 4;

???

参考: http://murmurhash.googlepages.com/

对不起,我的英语和我的愚蠢。 干杯

Sorry for my English and my stupidity. Cheers

推荐答案

在code可这里。 m和r是所使用的算法的常数。 K * = m表示采取变量k和多种它用m。 K ^ = K >> R意指采取k和右移位比特r地方(例如,如果r是2 110101将变得001101),然后用K XOR它

The code is available here . m and r are constants used by the algorithm. k *= m means take variable k and multiple it by m. k ^= k >> r means take k and right shift the bits r places (e.g. if r is 2 110101 would become 001101) and then XOR it with k.

希望给你足够的工作,通过各地。

Hope that gives you enough to work through the rest.

问候

这篇关于请解释一下杂音哈希?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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