Giter Site home page Giter Site logo

metrohash-c's Introduction

MetroHash: Faster, Better Hash Functions - C version

This is a C version of the reference MetroHash implementation by @jandrewrogers, originally written in C++.

MetroHash is a set of state-of-the-art hash functions for non-cryptographic use cases. They are notable for being algorithmically generated in addition to their exceptional performance. The set of published hash functions may be expanded in the future, having been selected from a very large set of hash functions that have been constructed this way.

  • Fastest general-purpose functions for bulk hashing.
  • Fastest general-purpose functions for small, variable length keys.
  • Robust statistical bias profile, similar to the MD5 cryptographic hash.
  • 64-bit, 128-bit, and 128-bit CRC variants currently available.
  • Optimized for modern x86-64 microarchitectures.
  • Elegant, compact, readable functions.

You can read more about the design and history here.

Six hash functions have been included in the initial release:

  • 64-bit hash functions, "metrohash64_1" and "metrohash64_2"
  • 128-bit hash functions, "metrohash128_1" and "metrohash128_2"
  • 128-bit hash functions using CRC instructions, "metrohash128crc_1" and "metrohash128crc_2"

Hash functions in the same family are effectively statistically unique. In other words, if you need two hash functions for a bloom filter, you can use "metrohash64_1" and "metrohash64_2" in the same implementation without issue. An unbounded set of statistically unique functions can be generated in each family. The functions in this repo were generated specifically for public release.

The hash function generation software made no effort toward portability. While these hash functions should be easily portable to big-endian microarchitectures, they have not been tested on them and the performance optimization algorithms were not targeted at them. ARM64 microarchitectures might be a worthwhile hash function generation targets if I had the hardware.

metrohash-c's People

Contributors

jandrewrogers avatar jedisct1 avatar

Stargazers

Thomas Leary avatar Maxime Tricoire avatar Adrian avatar Tom Bresson avatar Jérémie Astor avatar Pine Mizune avatar  avatar Pierre Kestener avatar Konstantinos avatar Manish Malik avatar Kevin Hatfield avatar Pranav Kulkarni avatar Angus H. avatar Eugene Scherba avatar  avatar Paul G avatar Charles E. Lehner avatar Erayd avatar Joseph Werle avatar Aaron Zauner avatar Omer Katz avatar  avatar Jonas Hermsmeier avatar Willem avatar Denis Denisov avatar Anthony Catel avatar

Watchers

 avatar James Cloos avatar  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.