Sha256: 9cdf52fd0ac108df80542b6b852c0e9a68d647cdef7338255bfa09ea828146fe

Contents?: true

Size: 308 Bytes

Versions: 18

Compression:

Stored size: 308 Bytes

Contents

module Gizzard
  module Digest
    def self.fnv1a_64(data)
      prime = 1099511628211
      rv = 0xcbf29ce484222325
      data.each_byte do |byte|
        rv = ((rv ^ (byte & 0xff)) * prime) & 0xffffffffffffffff
      end
      # trim to 60 bits for gizzard.
      rv & 0x0fffffffffffffff
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
gizzmo-0.13.1 lib/gizzard/digest.rb
gizzmo-0.13.0 lib/gizzard/digest.rb
gizzmo-0.12.1 lib/gizzard/digest.rb
gizzmo-0.12.0 lib/gizzard/digest.rb
gizzmo-0.11.4 lib/gizzard/digest.rb
gizzmo-0.11.3 lib/gizzard/digest.rb
gizzmo-0.11.2 lib/gizzard/digest.rb
gizzmo-0.11.1 lib/gizzard/digest.rb
gizzmo-0.11.0 lib/gizzard/digest.rb
gizzmo-0.10.1 lib/gizzard/digest.rb
gizzmo-0.10.0 lib/gizzard/digest.rb
gizzmo-0.9.0 lib/gizzard/digest.rb
gizzmo-0.8.3 lib/gizzard/digest.rb
gizzmo-0.8.2 lib/gizzard/digest.rb
gizzmo-0.8.1 lib/gizzard/digest.rb
gizzmo-0.8.0 lib/gizzard/digest.rb
gizzmo-0.7.5 lib/gizzard/digest.rb
gizzmo-0.7.4 lib/gizzard/digest.rb