Wyhash和Wyrand分别是理想的64位哈希功能和PRNG:
固体:怀施通过了Smhasher,Wyrand通过了Practrand的Bigcrush。
便携式:64位/32位系统,大/小恩迪安。
最快:在64位机器上有效,尤其是对于短键。
最简单:从代码大小的意义上讲。
盐:我们使用动态秘密来避免预期的攻击。
Wyhash是Great Zig,V,Nim和Go(自1.17)语言的默认哈希算法。一个里程碑是Microsoft在[Windows Terminal](Microsoft/Terminal#13686)上部署了Wyhash。
简单示例:
#include "wyhash.h"
uint64_t _wyp[4];
make_secret(time(NULL),_wyp);
string s="fcdskhfjs";
uint64_t h=wyhash(s.c_str(),s.size(),0,_wyp);
限制:
现在已经知道Wyhash/Wyrand有其局限性:
他们俩都不是64位抗碰撞,但大约是62位(飞行器/cyan4973/vigna)
当对更长的数据集进行测试(32TB,23天)时,Wyrand将失败Practrand(Vigna)
并且将来可能会发现更多缺陷。
用户应根据没有人是完美的,基于Wyhash/Wyrand的优势和缺陷。
C# https://github.com/cocowalla/wyhash-dotnet
C ++ https://github.com/tommyettinger/waterhash
C ++ https://github.com/alainesp/wy
去https://github.com/dgryski/go-wyhash
去https://github.com/orisano/wyhash
去https://github.com/littleli/go-wyhash16
去https://github.com/zeebo/wyhash
https://github.com/lonewolf3739/wyhash-go
GO https://github.com/zhangyunhao116/wyhash(最终版本1 && 3)
Java https://github.com/openhft/Zero-Allocation-Hashing
Java https://github.com/dynatrace-oss/hash4j(最终版本3和4)
kotlin互多平台https://github.com/appmattus/crypto/tree/main/main/cryptohash
nim https://github.com/nim-lang/nim/blob/devel/lib/pure/hashes.nim
nim https://github.com/jackhftang/wyhash.nim
nim https://github.com/littleli/nim-wyhash16
Rust https://github.com/eldruin/wyhash-rs
Swift https://github.com/lemire/swiftwyhash
Swift https://github.com/lemire/swiftwyhashbenchmark
Swift https://github.com/jeudesprits/pswyhash
v https://github.com/vlang/v/tree/master/vlib/hash/wyhash(v4)
Zig https://github.com/mandejan/zig-wyhash
absl hashmap https://github.com/abseil/abseil-cpp/blob/master/master/absl/hash/hash/internal/low_level_hash.h
我感谢这些名字:
雷尼城市
Dietrich Epp
约书亚·哈伯曼(Joshua Haberman)
Tommy Ettinger
丹尼尔·莱米尔(Daniel Lemire)
OTMAR ERTL
Cocowalla
狮子王
迭戈·巴里奥斯·罗梅罗
宝莉(Paulie-G)
Dumblob
Yann Collet
IVTE-MS
HYB
詹姆斯ZM高
EasyAspi314(Devin)
神经
飞行者
维格纳
坦西