https://github.com/timdeputter/Rendezvous
Implementation of the Rendezvous or Highest Random Weight (HRW) hashing algorithm in the Elixir Programming Language
https://github.com/timdeputter/Rendezvous
distributed-systems elixir elixir-lang elixir-programming-language hashing-algorithm
Last synced: 15 days ago
JSON representation
Implementation of the Rendezvous or Highest Random Weight (HRW) hashing algorithm in the Elixir Programming Language
- Host: GitHub
- URL: https://github.com/timdeputter/Rendezvous
- Owner: timdeputter
- License: mit
- Created: 2015-04-17T14:48:42.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-05T07:44:28.000Z (over 7 years ago)
- Last Synced: 2024-10-13T23:41:32.528Z (6 months ago)
- Topics: distributed-systems, elixir, elixir-lang, elixir-programming-language, hashing-algorithm
- Language: Elixir
- Size: 19.5 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Implementation of the Rendezvous or Highest Random Weight (HRW) hashing algorithm in Elixir. (Algorithms and Data structures)
- fucking-awesome-elixir - rendezvous - Implementation of the Rendezvous or Highest Random Weight (HRW) hashing algorithm in Elixir. (Algorithms and Data structures)
- awesome-elixir - rendezvous - Implementation of the Rendezvous or Highest Random Weight (HRW) hashing algorithm in Elixir. (Algorithms and Data structures)
README
Rendezvous [](https://travis-ci.org/timdeputter/Rendezvous) [](https://hex.pm/packages/Rendezvous) [](https://coveralls.io/r/Puddah/Rendezvous?branch=master) [](https://github.com/Puddah/Rendezvous/blob/master/LICENSE)
==========Implementation of the [Rendezvous or Highest Random Weight (HRW) hashing algorithm](https://en.wikipedia.org/wiki/Rendezvous_hashing) in the Elixir Programming Language ([elixir-lang.org](http://elixir-lang.org))
## Installation
Add rendezvous as a dependency in your mix.exs file:
```elixir
defp deps do
[
rendezvous: "~> 0.0.1"
]
end
```and run `mix deps.get`.
## Usage
Use Rendezvous.get to obtain for an object the corresponding bucket from a list of buckets. The first parameter defines the hashing algorithm to use.
```elixir
object = "Some object to put in bucket"
buckets = ["bucket A", "bucket B", "bucket C"]
Rendezvous.get(:sha, object, buckets)
```or use Rendezvous.get_node to obtain a nodename from the nodes in an elixir cluster:
```elixir
Rendezvous.get_node object # returns name of elixir node
```## License
Check [LICENSE](LICENSE) file for more information.