Wyhash y Wyrand son la función hash ideal de 64 bits y PRNG respectivamente:
Sólido : Wyhash pasó Smhasher, Wyrand pasó Bigcrush, Practrand.
Portable : sistema de 64 bits/32 bits, Big/Little Endian.
Más rápido : eficiente en máquinas de 64 bits, especialmente para teclas cortas.
más simple : en el sentido del tamaño del código.
Saled : usamos secreto dinámico para evitar el ataque previsto.
Wyhash es el algoritmo de hash predeterminado del lenguaje Great Zig, V, Nim y Go (desde 1.17). Un hito es que Wyhash ha implementado por Microsoft en [Windows Terminal] (Microsoft/Terminal#13686).
Ejemplo simple:
#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);
Limitaciones:
Ahora se sabe que Wyhash/Wyrand tiene sus limitaciones:
Ambos no son resistentes a la colisión de 64 bits, pero son aproximadamente 62 bits (FlyingMutant/Cyan4973/Vigna)
Cuando se prueba en un conjunto de datos más largo (32TB, 23 días), Wyrand fallará Practrand (Vigna)
Y puede haber más defectos detectados en el futuro.
El usuario debe tomar su propia decisión basada en la ventaja y los defectos de Wyhash/Wyrand, ya que nadie es perfecto.
C# https://github.com/cocowalla/wyhash-dotnet
C ++ https://github.com/tommyettinger/waterhash
C ++ https://github.com/alainesp/wy
Ir https://github.com/dgryski/go-wyhash
Ir https://github.com/orisano/wyhash
Vaya https://github.com/littleli/go-wyhash16
Ir https://github.com/zeebo/wyhash
Vaya https://github.com/lonewolf3739/wyhash-go
Vaya https://github.com/zhangyunhao116/wyhash (versión final 1 && 3)
Java https://github.com/openhft/zero-leatation-hashing
Java https://github.com/dynatrace-oss/hash4j (versión final 3 y 4)
Kotlin multiplataforma https://github.com/appmattus/crypto/tree/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
Óxido 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
Ajuste de hashmap https://github.com/abseil/abseil-cpp/blob/master/absl/hash/internal/low_level_hash.h
Agradezco estos nombres:
Reini urbano
Dietrich EPP
Joshua Haberman
Tommy Ettinger
Daniel Lemire
Otmar Ertl
cocowalla
Leo-Yuriev
Diego Barrios Romero
Paulie-G
dumblob
Yann Collet
IVTE-MS
hyb
James ZM Gao
Easyaspi314 (Devin)
Theonérico
volante
Vigna
tansa