提交 85ab68ee 编写于 作者: B bors

auto merge of #12749 : tedhorst/rust/master, r=huonw

Minor change to the FVN hashing function based on recommendation on: http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash

cc @alexcrichton
......@@ -118,8 +118,8 @@ impl Writer for FnvState {
fn write(&mut self, bytes: &[u8]) -> io::IoResult<()> {
let FnvState(mut hash) = *self;
for byte in bytes.iter() {
hash = hash * 0x100000001b3;
hash = hash ^ (*byte as u64);
hash = hash * 0x100000001b3;
}
*self = FnvState(hash);
Ok(())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册