module XXhash

Constants

VERSION

Public Class Methods

xxh32(input, seed = 0) click to toggle source
# File lib/ruby-xxhash.rb, line 10
def self.xxh32(input, seed = 0)
  xxh = XXhashInternal::XXhash32.new(seed)
  xxh.update(input)
  xxh.digest
end
xxh32_stream(io, seed = 0, chunk = 32) click to toggle source
# File lib/ruby-xxhash.rb, line 16
def self.xxh32_stream(io, seed = 0, chunk = 32)
  xxh = XXhashInternal::XXhash32.new(seed)

  while(data = io.read(chunk))
    xxh.update(data)
  end

  xxh.digest
end
xxh64(input, seed = 0) click to toggle source
# File lib/ruby-xxhash.rb, line 26
def self.xxh64(input, seed = 0)
  xxh = XXhashInternal::XXhash64.new(seed)
  xxh.update(input)
  xxh.digest
end
xxh64_stream(io, seed = 0, chunk = 32) click to toggle source
# File lib/ruby-xxhash.rb, line 32
def self.xxh64_stream(io, seed = 0, chunk = 32)
  xxh = XXhashInternal::XXhash64.new(seed)

  while(data = io.read(chunk))
    xxh.update(data)
  end

  xxh.digest
end