FNV-hash for Ruby

Provides a C-extension to calculate the FNV-hash in Ruby. Supports only FNV-1 and FNV-1a variants in 64bit.

Usage

require 'rbfnv'
Rbfnv.fnv1_64("string")  # => -7410993290581388146
Rbfnv.fnv1a_64("string") # => 8091808378024623192

Credits

  • robey for the initial implementation
  • menno for adapting it to 64-bits hashes and bundling it as a gem