hashabler

Principled, portable & extensible hashing of data and types, including an implementation of the FNV-1a and SipHash algorithms. https://github.com/jberryman/hashabler

Latest on Hackage:2.0.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed by Brandon Simmons

This package is a rewrite of the hashable library by Milan Straka and Johan Tibell, having the following goals:

  • Extensibility; it should be easy to implement a new hashing algorithm on any Hashable type; in this package we provide SipHash and FNV-1a.

  • Honest hashing of values, and principled hashing of algebraic data types (see e.g. hashable issues

    30)

  • Cross-platform consistent hash values, with a versioning guarantee. Where possible we ensure morally identical data hashes to indentical values regardless of processor word size and endianness.

  • Make implementing identical hash routines in other languages as painless as possible. In addition to SipHash, we provide an implementation of a simple hashing algorithm (FNV-1a) and make an effort to define Hashable instances in a way that is well-documented and sensible, so that e.g. one can easily implement a string hashing routine in JavaScript that will match the way we hash strings here.

Versioning: Except for instances where we specifically note that we make no promise of consistency, changes to hash values (and consequently changes to StableHashable values, where applicable) entail a major version number bump.

Changes

2.0.0

  • Use decodeFloat for Float and Double, for sanity and consistency with ghcjs. Hash values for these typed have changed.
  • Fix integer-gmp flag and support ghcjs (thanks to roelvandijk!)

1.3.0

  • Performance improvements
  • Implement a faster siphash-1-3

1.2.1

  • Eq, Read, Show for SipKey

1.2

  • SipKey is now a new data type with unboxed fields, instead of tuple
  • export a new mixType helper for defining StableHashable instances

1.1

  • Parameterize Hash32/64/128 types by the type of their hashed source data, to enforce legitimate equality comparisons of hashes.
  • Add StableHashable for distinguishing types with respect to their hashes across platforms and programs.

1.0

  • Added a mix64 method, in use in, Word/Int64 ByteString types and P.ByteArray
  • Hash renamed HashState and roll clarified in docs
  • instance Hashable of Float and Double now use mix32 and mix64 respectively.
  • Implemented 64-bit and 128-bit siphash
  • Instances up to 15-tuples. Now web scale!

0.1.0.2

  • (initial release)

comments powered byDisqus