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)
神經
飛行者
維格納
坦西