Kotlin Multiplatform (KMP) library for MurmurHash, a non-cryptographic hash function for general hash-based lookup focused on simplicity and performance.
Add the dependency in build.gradle.kts:
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.goncalossilva:murmurhash:<version>")
}
}
}
}Use the provided MurmurHash* classes and hash* hashing functions.
MurmurHash3().hash32x86(string.encodeToByteArray())Pull requests are welcome! See MurmurHash3Test for an example of how to leverage hashes computed by the canonical C++ implementation for testing.
Feel free to contribute earlier versions, such as MurmurHash2 and MurmurHash1.
Testing using a wordlist and pre-computed hashes of the canonical C++ implementation is inspired by @sangupta's murmur Java implementation.
Released under the MIT License.