{"id":42357537,"url":"https://github.com/escherba/python-metrohash","last_synced_at":"2026-01-27T16:36:35.666Z","repository":{"id":45133804,"uuid":"44377245","full_name":"escherba/python-metrohash","owner":"escherba","description":"Python bindings for MetroHash","archived":false,"fork":false,"pushed_at":"2025-10-09T21:30:20.000Z","size":361,"stargazers_count":19,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T13:36:01.634Z","etag":null,"topics":["cython","cython-wrapper","hashing","hashing-library","metrohash","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/metrohash/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/escherba.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-10-16T10:02:04.000Z","updated_at":"2025-10-09T21:30:24.000Z","dependencies_parsed_at":"2024-06-21T19:07:09.650Z","dependency_job_id":"3dda6194-3018-4962-92be-baf9630089a7","html_url":"https://github.com/escherba/python-metrohash","commit_stats":{"total_commits":160,"total_committers":3,"mean_commits":"53.333333333333336","dds":0.06874999999999998,"last_synced_commit":"4fe78ccdb8fbadf0b28a870c7db0cf7c9286bab2"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/escherba/python-metrohash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherba%2Fpython-metrohash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherba%2Fpython-metrohash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherba%2Fpython-metrohash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherba%2Fpython-metrohash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escherba","download_url":"https://codeload.github.com/escherba/python-metrohash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherba%2Fpython-metrohash/sbom","scorecard":{"id":382344,"data":{"date":"2025-08-11","repo":{"name":"github.com/escherba/python-metrohash","commit":"8f4be621ec5b489a7b4a7466cdd96608eb58aef4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":2,"reason":"2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/escherba/python-metrohash/publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:41","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:42","Warn: pipCommand not pinned by hash: .github/workflows/build.yml:48","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:68","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:77"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-29gw-9793-fvw7","Warn: Project is vulnerable to: PYSEC-2015-24 / GHSA-4vwq-x64q-j4cj","Warn: Project is vulnerable to: PYSEC-2017-46 / GHSA-66gw-5xpf-gfp5","Warn: Project is vulnerable to: PYSEC-2015-25 / GHSA-92mr-v722-f48m","Warn: Project is vulnerable to: PYSEC-2022-12 / GHSA-pq7m-3gw7-gq5x","Warn: Project is vulnerable to: PYSEC-2017-47","Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T15:45:24.959Z","repository_id":45133804,"created_at":"2025-08-18T15:45:24.959Z","updated_at":"2025-08-18T15:45:24.959Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28816563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cython","cython-wrapper","hashing","hashing-library","metrohash","python"],"created_at":"2026-01-27T16:36:35.611Z","updated_at":"2026-01-27T16:36:35.661Z","avatar_url":"https://github.com/escherba.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetroHash\n\nPython wrapper for [MetroHash](https://github.com/jandrewrogers/MetroHash), a\nfast non-cryptographic hash function.\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/escherba/python-metrohash/build.yml?branch=master)](https://github.com/escherba/python-metrohash/actions/workflows/build.yml)\n[![Latest Version](https://img.shields.io/pypi/v/metrohash.svg)](https://pypi.python.org/pypi/metrohash)\n[![License](https://img.shields.io/pypi/l/metrohash.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/metrohash.svg)](https://pypi.python.org/pypi/metrohash)\n\n## Getting Started\n\nTo use this package in your program, simply type\n\n``` bash\npip install metrohash\n```\n\nAfter that, you should be able to import the module and do things with\nit (see usage example below).\n\n## Usage Examples\n\n### Stateless hashing\n\nThis package provides Python interfaces to 64- and 128-bit\nimplementations of MetroHash algorithm. For stateless hashing, it\nexports `metrohash64` and `metrohash128` functions. Both take a value to\nbe hashed and an optional `seed` parameter:\n\n``` python\n\u003e\u003e\u003e import metrohash\n...\n\u003e\u003e\u003e metrohash.hash64_int(\"abc\", seed=0)\n17099979927131455419\n\u003e\u003e\u003e metrohash.hash128_int(\"abc\")\n182995299641628952910564950850867298725\n\n```\n\n### Incremental hashing\n\nUnlike its cousins CityHash and FarmHash, MetroHash allows incremental\n(stateful) hashing. For incremental hashing, use `MetroHash64` and\n`MetroHash128` classes. Incremental hashing is associative and\nguarantees that any combination of input slices will result in the same\nfinal hash value. This is useful for processing large inputs and stream\ndata. Example with two slices:\n\n``` python\n\u003e\u003e\u003e mh = metrohash.MetroHash64()\n\u003e\u003e\u003e mh.update(\"Nobody inspects\")\n\u003e\u003e\u003e mh.update(\" the spammish repetition\")\n\u003e\u003e\u003e mh.intdigest()\n7851180100622203313\n\n```\n\nThe resulting hash value above should be the same as in:\n\n``` python\n\u003e\u003e\u003e mh = metrohash.MetroHash64()\n\u003e\u003e\u003e mh.update(\"Nobody inspects the spammish repetition\")\n\u003e\u003e\u003e mh.intdigest()\n7851180100622203313\n\n```\n\n### Fast hashing of NumPy arrays\n\nThe Python [Buffer\nProtocol](https://docs.python.org/3/c-api/buffer.html) allows Python\nobjects to expose their data as raw byte arrays to other objects, for\nfast access without copying to a separate location in memory. Among\nothers, NumPy is a major framework that supports this protocol.\n\nAll hashing functions in this packege will read byte arrays from objects\nthat expose them via the buffer protocol. Here is an example showing\nhashing of a 4D NumPy array:\n\n``` python\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e arr = np.zeros((256, 256, 4))\n\u003e\u003e\u003e metrohash.hash64_int(arr)\n12125832280816116063\n\n```\n\nThe arrays need to be contiguous for this to work. To convert a\nnon-contiguous array, use NumPy's `ascontiguousarray()` function.\n\n## Development\n\n### Local workflow\n\nFor those who want to contribute, here is a quick start using some\nmakefile commands:\n\n``` bash\ngit clone https://github.com/escherba/python-metrohash.git\ncd python-metrohash\nmake env           # create a virtual environment\nmake test          # run Python tests\nmake cpp-test      # run C++ tests\nmake shell         # enter IPython shell\n```\n\nTo find out which Make targets are available, type:\n\n``` bash\nmake help\n```\n\n### Distribution\n\nThe wheels are built using [cibuildwheel](https://cibuildwheel.readthedocs.io/)\nand are distributed to PyPI using GitHub actions. The wheels contain compiled\nbinaries and are available for the following platforms: windows-amd64,\nubuntu-x86, linux-x86\\_64, linux-aarch64, and macosx-x86\\_64.\n\n## See Also\n\nFor other fast non-cryptographic hash functions available as Python\nextensions, see [FarmHash](https://github.com/escherba/python-cityhash)\nand [MurmurHash](https://github.com/hajimes/mmh3).\n\n## Authors\n\nThe MetroHash algorithm and C++ implementation is due to J. Andrew\nRogers. The Python bindings for it were written by Eugene Scherba.\n\n## License\n\nThis software is licensed under the [Apache License,\nVersion 2.0](https://opensource.org/licenses/Apache-2.0). See the\nincluded LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherba%2Fpython-metrohash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescherba%2Fpython-metrohash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherba%2Fpython-metrohash/lists"}