{"id":15056395,"url":"https://github.com/farhadi/xxh3","last_synced_at":"2025-05-08T21:13:02.906Z","repository":{"id":54142285,"uuid":"329451761","full_name":"farhadi/xxh3","owner":"farhadi","description":"Erlang NIF bindings for XXH3 hash functions implemented in Rust","archived":false,"fork":false,"pushed_at":"2024-11-19T14:07:02.000Z","size":40,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T21:12:39.083Z","etag":null,"topics":["erlang","erlang-nif","hash-functions","nif","non-cryptographic-hash-functions","xxh3","xxhash"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/farhadi.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}},"created_at":"2021-01-13T22:56:48.000Z","updated_at":"2024-11-19T13:27:59.000Z","dependencies_parsed_at":"2024-10-30T15:38:30.610Z","dependency_job_id":null,"html_url":"https://github.com/farhadi/xxh3","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"133bd33db0613ddd21b4ce9b802dad2338341667"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farhadi%2Fxxh3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farhadi%2Fxxh3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farhadi%2Fxxh3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farhadi%2Fxxh3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farhadi","download_url":"https://codeload.github.com/farhadi/xxh3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149617,"owners_count":21861739,"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":["erlang","erlang-nif","hash-functions","nif","non-cryptographic-hash-functions","xxh3","xxhash"],"created_at":"2024-09-24T21:50:42.900Z","updated_at":"2025-05-08T21:13:02.876Z","avatar_url":"https://github.com/farhadi.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XXH3\n\n[![CI build status](https://github.com/farhadi/xxh3/workflows/CI/badge.svg)](https://github.com/farhadi/xxh3/actions?query=workflow%3ACI)\n[![Hex docs](http://img.shields.io/badge/hex.pm-docs-green.svg?style=flat)](https://hexdocs.pm/xxh3)\n[![Hex Version](http://img.shields.io/hexpm/v/xxh3.svg?style=flat)](https://hex.pm/packages/xxh3)\n[![License](http://img.shields.io/hexpm/l/xxh3.svg?style=flat)](https://github.com/farhadi/xxh3/blob/master/LICENSE)\n\nErlang NIF bindings for XXH3 hash functions implemented in Rust.\n\n## Introduction\n\nXXH3 is a new speed-optimized hash algorithm of the [xxHash](https://cyan4973.github.io/xxHash/)\nfamily of non-cryptographic hash functions, featuring:\n\n  - Improved speed for both small and large inputs\n  - True 64-bit and 128-bit outputs\n  - SIMD acceleration\n  - Improved 32-bit viability\n\nSpeed analysis methodology is explained [here](https://fastcompression.blogspot.com/2019/03/presenting-xxh3.html).\n\n## Implementation\n\nErlang nif interface does not support passing bigints to the VM, so for 128-bit variants\na 128-bit binary is passed, and then converted to a 128-bit integer in erlang.\n\n## Usage\nNote that only binary data is accepted. For other types of data you can\nfirst convert them to a binary using `erlang:term_to_binary/1`.\n\nIn Erlang\n\n```erlang\nData = \u003c\u003c\"Test Data\"\u003e\u003e,\nSeed = 1,\nSecret = crypto:strong_rand_bytes(136),\n\nH64 = xxh3:hash64(Data),\nH64WithSeed = xxh3:hash64(Data, Seed),\nH64WithSecret = xxh3:hash64_with_secret(Data, Secret),\n\nH128 = xxh3:hash128(Data),\nH128WithSeed = xxh3:hash128(Data, Seed),\nH128WithSecret = xxh3:hash128_with_secret(Data, Secret).\n\nH64Stream = xxh3:new(),\nxxh3:update(H64Stream, Data),\nH64 = xxh3:digest(H64Stream)\n```\n\nIn Elixir\n\n```elixir\ndata = \"Test Data\"\nseed = 1\nsecret = :crypto.strong_rand_bytes(136)\n\nh64 = :xxh3.hash64(data)\nh64_with_seed = :xxh3.hash64(data, seed)\nh64_with_secret = :xxh3.hash64_with_secret(data, secret)\n\nh128 = :xxh3.hash128(data)\nh128_with_seed = :xxh3.hash128(data, seed)\nh128_with_secret = :xxh3.hash128_with_secret(data, secret)\n\nh64_stream = :xxh3.new(),\n:xxh3.update(h64_stream, data),\nh64 = :xxh3.digest(h64_stream)\n```\n\nFor more details, see the module documentation.\n\n## License\n\nCopyright 2021, Ali Farhadi \u003ca.farhadi@gmail.com\u003e.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhadi%2Fxxh3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarhadi%2Fxxh3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhadi%2Fxxh3/lists"}