Coder Social home page Coder Social logo

patricktoca / wyhash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangyi-fudan/wyhash

0.0 1.0 0.0 9.63 MB

The FASTEST QUALITY hash function, random number generators (PRNG) and hash map.

License: The Unlicense

C++ 28.80% Makefile 0.82% C 70.38%

wyhash's Introduction

No hash function is perfect, but some are useful.

wyhash and wyrand are the ideal 64-bit hash function and PRNG respectively:

solid: wyhash passed SMHasher, wyrand passed BigCrush, practrand.

portable: 64-bit/32-bit system, big/little endian.

fastest: Efficient on 64-bit machines, especially for short keys.

simplest: In the sense of code size.

salted: We use dynamic secret to avoid intended attack.

wyhash is the default hasher for a hash table of the great Zig, V and Nim language.

Simple Example:

#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);

g++-9 benchmark.cpp t1ha/src/t1ha2.c -o benchmark -Ofast -s -Wall -march=native

/usr/share/dict/words

hash function short hash/us bulk_256B GB/s bulk_64KB GB/s
wyhash_final3 419.63 20.97 25.10
wyhash_final2 204.08 21.12 25.10
wyhash_final1 196.33 15.56 17.92
wyhash_gamma (dangerous) 399.92 19.16 25.80
wyhash_beta 180.51 18.20 17.37
wyhash_alpha 204.50 20.54 25.92
wyhash_v6 (avx2) 164.08 12.08 41.35
wyhash_v5 221.59 15.40 16.78
wyhash_v4 153.03 13.89 16.81
wyhash_v3 191.32 13.55 15.72
wyhash_v2 94.28 11.91 11.22
wyhash_v1 91.66 16.03 18.95
wyhash32 (32 bit) 149.78 5.45 4.89
xxh3_scalar 152.47 8.39 13.05
xxh3_avx2 144.62 9.85 44.82

C# https://github.com/cocowalla/wyhash-dotnet

C++ https://github.com/tommyettinger/waterhash

GO https://github.com/dgryski/go-wyhash

GO https://github.com/orisano/wyhash

GO https://github.com/littleli/go-wyhash16

GO https://github.com/zeebo/wyhash

GO https://github.com/lonewolf3739/wyhash-go

GO https://github.com/zhangyunhao116/wyhash (final version 1)

Java https://github.com/OpenHFT/Zero-Allocation-Hashing

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/absl/hash/internal/wyhash.cc


I thank these names:

Reini Urban

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 Z.M. Gao

easyaspi314 (Devin)

TheOneric

wyhash's People

Contributors

0xflotus avatar easyaspi314 avatar eldruin avatar gzm55 avatar joe-conigliaro avatar jsteemann avatar lemire avatar nwellnhof avatar oertl avatar paulie-g avatar ringabout avatar rurban avatar theoneric avatar wangyi-fudan avatar zhangyunhao116 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.