Sha256: 84555e9b7c819d58f59a0b80ea1d6004d36f242d6a41fad968097cd48e4d1d35

Contents?: true

Size: 424 Bytes

Versions: 1

Compression:

Stored size: 424 Bytes

Contents

require 'xxhash/version'
require 'xxhash/xxhash'

module XXhash
  def self.xxh32(input, seed)
    Internal.xxh32(input, seed)
  end

  def self.xxh32_stream(io, seed, chunk_size = 32)
    raise ArgumentError, 'first argument should be IO' if !io.is_a?(IO) && !io.is_a?(StringIO)

    hash = Internal::StreamingHash.new(seed)

    while chunk = io.read(chunk_size)
      hash.update(chunk)
    end

    hash.digest
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xxhash-0.2.0 lib/xxhash.rb