Skip to content

Kotlin Multiplatform (KMP) library for hashing using MurmurHash

License

Notifications You must be signed in to change notification settings

CrossPaste/kotlinx-murmurhash

 
 

Repository files navigation

kotlinx-murmurhash

badge-version badge-jvm badge-js badge-nodejs badge-android badge-ios badge-watchos badge-tvos badge-macos badge-windows badge-linux

Kotlin Multiplatform (KMP) library for MurmurHash, a non-cryptographic hash function for general hash-based lookup focused on simplicity and performance.

Usage

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.

Example

MurmurHash3().hash32x86(string.encodeToByteArray())

Contributing

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.

Acknowledgements

Testing using a wordlist and pre-computed hashes of the canonical C++ implementation is inspired by @sangupta's murmur Java implementation.

License

Released under the MIT License.

About

Kotlin Multiplatform (KMP) library for hashing using MurmurHash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 97.9%
  • Shell 1.7%
  • JavaScript 0.4%