Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby wrapper for xxHash
C Ruby
branch: master

README.md

xxHash Build Status

Ruby wrapper for xxHash

Install

gem install xxhash

Usage

require 'xxhash'

text = "test"
seed = 12345

XXhash.xxh32(text, seed) # => 3834992036

If you does not provide a seed, it will use the default value 0.

You can use it with IO objects too:

XXhash.xxh32_stream(StringIO.new('test'), 123) # => 2758658570

Note that you can also pass a chunk size as third param (it's 32 bytes by default)

XXH64 is also supported: you can use xxh64 and xxh64_stream.

Supported Ruby versions

  • MRI 1.9.3, 2.0, 2.1, 2.2.
  • rbx-19mode

Note: It doesn't work on JRuby as it uses C extension.

Versioning

Version 0.2.0 is equal to r32

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2013 Vasiliy Ermolovich. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.