Skip to content

Instantly share code, notes, and snippets.

@methylene
Last active March 26, 2023 17:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save methylene/8420414 to your computer and use it in GitHub Desktop.
Save methylene/8420414 to your computer and use it in GitHub Desktop.
murmur hash in clojure
(def murmur
(let [m (com.google.common.hash.Hashing/murmur3_128)]
(fn ^Long [^String s]
(-> (doto (.newHasher m)
(.putString s com.google.common.base.Charsets/UTF_8))
(.hash)
(.asLong)))))
@methylene
Copy link
Author

[com.google.guava/guava "15.0"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment