https://github.com/yoshoku/mmh3
A pure Ruby implementation of MurmurHash3.
https://github.com/yoshoku/mmh3
Last synced: 6 months ago
JSON representation
A pure Ruby implementation of MurmurHash3.
- Host: GitHub
- URL: https://github.com/yoshoku/mmh3
- Owner: yoshoku
- License: mit
- Created: 2020-02-05T12:15:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T11:37:49.000Z (10 months ago)
- Last Synced: 2025-04-19T04:55:41.305Z (6 months ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/mmh3
- Size: 58.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Mmh3
[](https://github.com/yoshoku/mmh3/actions?query=workflow%3Abuild)
[](https://badge.fury.io/rb/mmh3)
[](https://rubydoc.info/gems/mmh3)A pure Ruby implementation of [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash).
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mmh3'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install mmh3
## Usage
```ruby
irb(main):001:0> require 'mmh3'
=> true
irb(main):002:0> Mmh3.hash32('Hello, world', seed: 3)
=> 1659891412
irb(main):003:0> Mmh3.hash128('Hello, world', seed: 8)
=> 87198040132278428547135563345531192982
irb(main):004:0> Mmh3.hash32('Hello, world')
=> 1785891924
irb(main):005:0> Mmh3.hash32('Hello, world', seed: 0)
=> 1785891924
irb(main):006:0>
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/mmh3.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).