Skip to content

jrslepak/murmur3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an FFI wrapper for MurmurHash3, a general-purpose hash function. MurmurHash3 is suitable for use in data structures which need a hash function but NOT for cryptographic use.

In order to use this package, the MurmurHash3 C function must be built as a shared library, which can be done with the included Makefile.

Contract

(murmur-hash data [seed]) → fixnum?
  data : (or/c string? bytes?)
  seed : exact-nonnegative-integer? = 0

Calls a MurmurHash3 function chosen based on fixnum size – 32-bit version on 32-bit machines and 128-bit version on 64-bit machines. One fixnum’s worth of bits are taken from the result.

Examples

> (murmur-hash "hello, world!")
2382026736043989338

> (murmur-hash "hello, world!" 12648430)
-1035544952122395943

About

Racket FFI binding for MurmurHash3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •