{"id":13564895,"url":"https://github.com/twmb/murmur3","last_synced_at":"2025-05-15T09:05:54.647Z","repository":{"id":37788998,"uuid":"127841421","full_name":"twmb/murmur3","owner":"twmb","description":"Fast, fully fledged murmur3 in Go.","archived":false,"fork":false,"pushed_at":"2023-06-01T15:34:36.000Z","size":83,"stargazers_count":325,"open_issues_count":0,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T15:00:56.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twmb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-03T02:47:35.000Z","updated_at":"2025-04-06T03:14:45.000Z","dependencies_parsed_at":"2024-01-14T04:06:14.053Z","dependency_job_id":null,"html_url":"https://github.com/twmb/murmur3","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twmb%2Fmurmur3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twmb%2Fmurmur3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twmb%2Fmurmur3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twmb%2Fmurmur3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twmb","download_url":"https://codeload.github.com/twmb/murmur3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310513,"owners_count":22049468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:37.656Z","updated_at":"2025-05-15T09:05:54.601Z","avatar_url":"https://github.com/twmb.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"murmur3\n=======\n\nNative Go implementation of Austin Appleby's third MurmurHash revision (aka\nMurmurHash3).\n\nIncludes assembly for amd64 for 64/128 bit hashes, seeding functions,\nand string functions to avoid string to slice conversions.\n\nHand rolled 32 bit assembly was removed during 1.11, but may be reintroduced\nif the compiler slows down any more. As is, the compiler generates marginally\nslower code (by one instruction in the hot loop).\n\nThe reference algorithm has been slightly hacked as to support the streaming mode\nrequired by Go's standard [Hash interface](http://golang.org/pkg/hash/#Hash).\n\nEndianness\n==========\n\nUnlike the canonical source, this library **always** reads bytes as little\nendian numbers. This makes the hashes portable across architectures, although\ndoes mean that hashing is a bit slower on big endian architectures.\n\nSafety\n======\n\nThis library used to use `unsafe` to convert four bytes to a `uint32` and eight\nbytes to a `uint64`, but Go 1.14 introduced checks around those types of\nconversions that flagged that code as erroneous when hashing on unaligned\ninput. While the code would not be problematic on amd64, it could be\nproblematic on some architectures.\n\nAs of Go 1.14, those conversions were removed at the expense of a very minor\nperformance hit. This hit affects all cpu architectures on for `Sum32`, and\nnon-amd64 architectures for `Sum64` and `Sum128`. For 64 and 128, custom\nassembly exists for amd64 that preserves performance.\n\nTesting\n=======\n\n[![Build Status](https://travis-ci.org/twmb/murmur3.svg?branch=master)](https://travis-ci.org/twmb/murmur3)\n\nTesting includes comparing random inputs against the [canonical\nimplementation](https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp),\nand testing length 0 through 17 inputs to force all branches.\n\nBecause this code always reads input as little endian, testing against the\ncanonical source is skipped for big endian architectures. The canonical source\njust converts bytes to numbers, meaning on big endian architectures, it will\nuse different numbers for its hashing.\n\nDocumentation\n=============\n\n[![GoDoc](https://godoc.org/github.com/twmb/murmur3?status.svg)](https://godoc.org/github.com/twmb/murmur3)\n\nFull documentation can be found on `godoc`.\n\nBenchmarks\n==========\n\nBenchmarks below were run on an amd64 machine with _and_ without the custom\nassembly. The following numbers are for Go 1.14.1 and are comparing against\n[spaolacci/murmur3](https://github.com/spaolacci/murmur3).\n\nYou will notice that at small sizes, the other library is better. This is due\nto this library converting to safe code for Go 1.14. At large sizes, this\nlibrary is nearly identical to the other. On amd64, the 64 bit and 128 bit\nsums come out to ~9% faster.\n\n32 bit sums:\n\n```\n32Sizes/32-12     3.00GB/s ± 1%  2.12GB/s ±11%  -29.24%  (p=0.000 n=9+10)\n32Sizes/64-12     3.61GB/s ± 3%  2.79GB/s ± 8%  -22.62%  (p=0.000 n=10+10)\n32Sizes/128-12    3.47GB/s ± 8%  2.79GB/s ± 4%  -19.47%  (p=0.000 n=10+10)\n32Sizes/256-12    3.66GB/s ± 4%  3.25GB/s ± 6%  -11.09%  (p=0.000 n=10+10)\n32Sizes/512-12    3.78GB/s ± 3%  3.54GB/s ± 4%   -6.30%  (p=0.000 n=9+9)\n32Sizes/1024-12   3.86GB/s ± 3%  3.69GB/s ± 5%   -4.46%  (p=0.000 n=10+10)\n32Sizes/2048-12   3.85GB/s ± 3%  3.81GB/s ± 3%     ~     (p=0.079 n=10+9)\n32Sizes/4096-12   3.90GB/s ± 3%  3.82GB/s ± 2%   -2.14%  (p=0.029 n=10+10)\n32Sizes/8192-12   3.82GB/s ± 3%  3.78GB/s ± 7%     ~     (p=0.529 n=10+10)\n```\n\n64/128 bit sums, non-amd64:\n\n```\n64Sizes/32-12     2.34GB/s ± 5%  2.64GB/s ± 9%  +12.87%  (p=0.000 n=10+10)\n64Sizes/64-12     3.62GB/s ± 5%  3.96GB/s ± 4%   +9.41%  (p=0.000 n=10+10)\n64Sizes/128-12    5.12GB/s ± 3%  5.44GB/s ± 4%   +6.09%  (p=0.000 n=10+9)\n64Sizes/256-12    6.35GB/s ± 2%  6.27GB/s ± 9%     ~     (p=0.796 n=10+10)\n64Sizes/512-12    6.58GB/s ± 7%  6.79GB/s ± 3%     ~     (p=0.075 n=10+10)\n64Sizes/1024-12   7.49GB/s ± 3%  7.55GB/s ± 9%     ~     (p=0.393 n=10+10)\n64Sizes/2048-12   8.06GB/s ± 2%  7.90GB/s ± 6%     ~     (p=0.156 n=9+10)\n64Sizes/4096-12   8.27GB/s ± 6%  8.22GB/s ± 5%     ~     (p=0.631 n=10+10)\n64Sizes/8192-12   8.35GB/s ± 4%  8.38GB/s ± 6%     ~     (p=0.631 n=10+10)\n128Sizes/32-12    2.27GB/s ± 2%  2.68GB/s ± 5%  +18.00%  (p=0.000 n=10+10)\n128Sizes/64-12    3.55GB/s ± 2%  4.00GB/s ± 3%  +12.47%  (p=0.000 n=8+9)\n128Sizes/128-12   5.09GB/s ± 1%  5.43GB/s ± 3%   +6.65%  (p=0.000 n=9+9)\n128Sizes/256-12   6.33GB/s ± 3%  5.65GB/s ± 4%  -10.79%  (p=0.000 n=9+10)\n128Sizes/512-12   6.78GB/s ± 3%  6.74GB/s ± 6%     ~     (p=0.968 n=9+10)\n128Sizes/1024-12  7.46GB/s ± 4%  7.56GB/s ± 4%     ~     (p=0.222 n=9+9)\n128Sizes/2048-12  7.99GB/s ± 4%  7.96GB/s ± 3%     ~     (p=0.666 n=9+9)\n128Sizes/4096-12  8.20GB/s ± 2%  8.25GB/s ± 4%     ~     (p=0.631 n=10+10)\n128Sizes/8192-12  8.24GB/s ± 2%  8.26GB/s ± 5%     ~     (p=0.673 n=8+9)\n```\n\n64/128 bit sums, amd64:\n\n```\n64Sizes/32-12     2.34GB/s ± 5%  4.36GB/s ± 3%  +85.86%  (p=0.000 n=10+10)\n64Sizes/64-12     3.62GB/s ± 5%  6.27GB/s ± 3%  +73.37%  (p=0.000 n=10+9)\n64Sizes/128-12    5.12GB/s ± 3%  7.70GB/s ± 6%  +50.27%  (p=0.000 n=10+10)\n64Sizes/256-12    6.35GB/s ± 2%  8.61GB/s ± 3%  +35.50%  (p=0.000 n=10+10)\n64Sizes/512-12    6.58GB/s ± 7%  8.59GB/s ± 4%  +30.48%  (p=0.000 n=10+9)\n64Sizes/1024-12   7.49GB/s ± 3%  8.81GB/s ± 2%  +17.66%  (p=0.000 n=10+10)\n64Sizes/2048-12   8.06GB/s ± 2%  8.90GB/s ± 4%  +10.49%  (p=0.000 n=9+10)\n64Sizes/4096-12   8.27GB/s ± 6%  8.90GB/s ± 4%   +7.54%  (p=0.000 n=10+10)\n64Sizes/8192-12   8.35GB/s ± 4%  9.00GB/s ± 3%   +7.80%  (p=0.000 n=10+9)\n128Sizes/32-12    2.27GB/s ± 2%  4.29GB/s ± 9%  +88.75%  (p=0.000 n=10+10)\n128Sizes/64-12    3.55GB/s ± 2%  6.10GB/s ± 8%  +71.78%  (p=0.000 n=8+10)\n128Sizes/128-12   5.09GB/s ± 1%  7.62GB/s ± 9%  +49.63%  (p=0.000 n=9+10)\n128Sizes/256-12   6.33GB/s ± 3%  8.65GB/s ± 3%  +36.71%  (p=0.000 n=9+10)\n128Sizes/512-12   6.78GB/s ± 3%  8.39GB/s ± 6%  +23.77%  (p=0.000 n=9+10)\n128Sizes/1024-12  7.46GB/s ± 4%  8.70GB/s ± 4%  +16.70%  (p=0.000 n=9+10)\n128Sizes/2048-12  7.99GB/s ± 4%  8.73GB/s ± 8%   +9.26%  (p=0.003 n=9+10)\n128Sizes/4096-12  8.20GB/s ± 2%  8.86GB/s ± 6%   +8.00%  (p=0.000 n=10+10)\n128Sizes/8192-12  8.24GB/s ± 2%  9.01GB/s ± 3%   +9.30%  (p=0.000 n=8+10)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwmb%2Fmurmur3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwmb%2Fmurmur3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwmb%2Fmurmur3/lists"}