{"id":13582342,"url":"https://github.com/segmentio/fasthash","last_synced_at":"2025-10-19T02:28:30.603Z","repository":{"id":50340925,"uuid":"94148671","full_name":"segmentio/fasthash","owner":"segmentio","description":"Go package porting the standard hashing algorithms to a more efficient implementation.","archived":false,"fork":false,"pushed_at":"2024-07-04T03:00:01.000Z","size":33,"stargazers_count":292,"open_issues_count":3,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T05:35:21.393Z","etag":null,"topics":["fnv-1a","go","golang","hash","hashing-algorithms","paused","segment"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/segmentio.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":"2017-06-12T23:13:15.000Z","updated_at":"2025-02-05T02:17:25.000Z","dependencies_parsed_at":"2023-02-06T08:15:16.271Z","dependency_job_id":"472b10bb-66c3-471f-9f4c-7834870a2df2","html_url":"https://github.com/segmentio/fasthash","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Ffasthash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Ffasthash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Ffasthash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentio%2Ffasthash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segmentio","download_url":"https://codeload.github.com/segmentio/fasthash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495680,"owners_count":20948095,"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":["fnv-1a","go","golang","hash","hashing-algorithms","paused","segment"],"created_at":"2024-08-01T15:02:37.090Z","updated_at":"2025-10-19T02:28:25.571Z","avatar_url":"https://github.com/segmentio.png","language":"Go","readme":"# fasthash [![CircleCI](https://circleci.com/gh/segmentio/fasthash.svg?style=shield)](https://circleci.com/gh/segmentio/fasthash) [![Go Report Card](https://goreportcard.com/badge/github.com/segmentio/fasthash)](https://goreportcard.com/report/github.com/segmentio/fasthash) [![GoDoc](https://godoc.org/github.com/segmentio/fasthash?status.svg)](https://godoc.org/github.com/segmentio/fasthash)\nGo package porting the standard hashing algorithms to a more efficient implementation.\n\n\u003e **Note**  \n\u003e Segment has paused maintenance on this project, but may return it to an active status in the future. Issues and pull requests from external contributors are not being considered, although internal contributions may appear from time to time. The project remains available under its open source license for anyone to use.\n\n## Motivations\n\nGo has great support for hashing algorithms in the standard library, but the\nAPIs are all exposed as interfaces, which means passing strings or byte slices\nto those require dynamic memory allocations. Hashing a string typically requires\n2 allocations, one for the Hash value, and one to covert the string to a byte\nslice.\n\nThis package attempts to solve this issue by exposing functions that implement\nstring hashing algorithms and don't require dynamic memory alloations.\n\n## Testing\n\nTo ensure consistency between the `fasthash` package and the standard library,\nall tests must be implemented to run against the standard hash functions and\nvalidate that both packages produced the same results.\n\n## Benchmarks\n\nThe implementations also have to prove that they are more efficient in terms of\nCPU and memory usage than the functions found in the standard library.  \nHere's an example with fnv-1a:\n```\nBenchmarkHash64/standard_hash_function 20000000   105.0 ns/op   342.31 MB/s   56 B/op   2 allocs/op\nBenchmarkHash64/hash_function          50000000    38.6 ns/op   932.35 MB/s    0 B/op   0 allocs/op\n```\n\n# Usage Example: FNV-1a\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/segmentio/fasthash/fnv1a\"\n)\n\nfunc main() {\n    // Hash a single string.\n    h1 := fnv1a.HashString64(\"Hello World!\")\n    fmt.Println(\"FNV-1a hash of 'Hello World!':\", h1)\n\n    // Incrementally compute a hash value from a sequence of strings.\n    h2 := fnv1a.Init64\n    h2 = fnv1a.AddString64(h2, \"A\")\n    h2 = fnv1a.AddString64(h2, \"B\")\n    h2 = fnv1a.AddString64(h2, \"C\")\n    fmt.Println(\"FNV-1a hash of 'ABC':\", h2)\n}\n```\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegmentio%2Ffasthash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegmentio%2Ffasthash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegmentio%2Ffasthash/lists"}