benbjohnson / Jmphash
Licence: mit
Implementation of the Jump Consistent Hash algorithm in Go.
Stars: ✭ 152
Programming Languages
go
31211 projects - #10 most used programming language
jmphash
Implementation of the Jump Consistent Hash algorithm in Go. This algorithm performs consistent hashing on integer keys and maps them to integer buckets.
Usage
To use jmphash, simply create a Hasher
with the number of buckets you want
to map to and then call the Hash()
function with your key. This function
will return the bucket that your key is mapped to.
import "github.com/benbjohnson/jmphash"
func main() {
// Create a hash with 100 buckets.
h := jmphash.NewHasher(100)
// Map keys to their appropriate buckets.
bucket := h.Hash(12387)
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].