Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ttvd/elixir-xxhash
Pure Elixir implementation of xxHash.
https://github.com/ttvd/elixir-xxhash
elixir hashing xxhash
Last synced: 7 days ago
JSON representation
Pure Elixir implementation of xxHash.
- Host: GitHub
- URL: https://github.com/ttvd/elixir-xxhash
- Owner: ttvd
- Created: 2015-05-03T03:47:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T07:29:31.000Z (about 2 years ago)
- Last Synced: 2024-09-25T19:30:09.758Z (10 days ago)
- Topics: elixir, hashing, xxhash
- Language: Elixir
- Homepage:
- Size: 22.5 KB
- Stars: 28
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
elixir-xxhash
======This is a pure Elixir implementation of [xxHash](https://github.com/Cyan4973/xxHash)
## Usage
Add dependency in your mix.exs file:
```
def deps do
[{:xxhash, "~> 0.3.1"}]
end
```
Once this is done, execute mix deps.get to fetch and compile elixir-xxhash.## Running in iex
Run with iex -S mix
```
iex(4)> XXHash.xxh32("")
0
iex(5)> XXHash.xxh32("0")
1212501170
iex(6)> XXHash.xxh32("abcd")
2741253893
iex(7)> XXHash.xxh32("abcde")
2537091483
iex(8)> XXHash.xxh32("xxhash") == XXHash.xxh32("xxhash")
true
iex(9)> XXHash.xxh32("0123456789abcde")
498989583
iex(10)> XXHash.xxh32("0123456789abcdef")
3267648361
iex(11)> XXHash.xxh32("0123456789abcdefg")
3430527511
```## Limitations
* This is still work in progress.## Notes
* You should consider creating a NIF of [xxHash](https://github.com/Cyan4973/xxHash) if you require a high performance version.## License and copyright
* (c) 2015, Mykola Konyk
* Original [xxHash](https://github.com/Cyan4973/xxHash) (c) 2012-2014, Yann Collet
* Distributed under the [MS-RL License.](http://opensource.org/licenses/MS-RL)