ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - whitfin/jumper: Jump consistent hash implementation in Elixir (without NIFs)
Jump consistent hash implementation in Elixir (without NIFs) - whitfin/jumper
Visit Site

GitHub - whitfin/jumper: Jump consistent hash implementation in Elixir (without NIFs)

GitHub - whitfin/jumper: Jump consistent hash implementation in Elixir (without NIFs)

Jumper

Build Status Coverage Status Hex.pm Version Documentation

Installation

Jumper is available on Hex. You can install the package by adding it to your dependencies in mix.exs:

def deps do
 [{:jumper, "~> 1.0"}]
end

Usage

Using Jumper is pretty trivial; there is a single API used to slot keys into a range of buckets:

iex> Jumper.slot(256, 1024)
520

The first argument is the key, and the second is the number of buckets the key can be slotted into. The result is the bucket the key should be routed to. Both the key and the bucket count should be valid integers. If you want to check a non-integer key, you could always use :erlang.phash2/1 to generate a hash code for the value:

iex> %{} |> :erlang.phash2 |> Jumper.slot(1024)
29

Benchmarks

There are some very trivial benchmarks available using Benchee in the benchmarks/ directory. You can run the benchmarks using the following command:

$ mix bench

Typical results are a microsecond or two, based on the number of buckets you're trying to slot into (scales to the number of buckets).

Contributions

If you feel something can be improved, or have any questions about certain behaviours or pieces of implementation, please feel free to file an issue. Proposed changes should be taken to issues before any PRs to avoid wasting time on code which might not be merged upstream.

If you do make changes to the codebase, please make sure you test your changes thoroughly, and include any unit tests alongside new or changed behaviours. jumper currently uses the excellent excoveralls to track code coverage.

$ mix test
$ mix credo
$ mix coveralls
$ mix coveralls.html && open cover/excoveralls.html

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory