{"id":13813560,"url":"https://github.com/tidwall/hashmap","last_synced_at":"2025-08-01T17:34:31.560Z","repository":{"id":43027043,"uuid":"471112842","full_name":"tidwall/hashmap","owner":"tidwall","description":"A simple and efficient hashmap package for Go. Open addressing, robin hood hashing, and xxh3 algorithm.  Supports generics.","archived":false,"fork":false,"pushed_at":"2023-03-31T14:35:59.000Z","size":35,"stargazers_count":218,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-20T02:06:10.281Z","etag":null,"topics":["hash","hashmap","hashtable","map","table"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidwall.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":"2022-03-17T19:18:32.000Z","updated_at":"2025-04-25T16:06:52.000Z","dependencies_parsed_at":"2024-06-18T17:01:43.572Z","dependency_job_id":"8fe21eb6-e3a0-449e-8aa6-e8bc0a8e024c","html_url":"https://github.com/tidwall/hashmap","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/tidwall/hashmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidwall%2Fhashmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidwall%2Fhashmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidwall%2Fhashmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidwall%2Fhashmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidwall","download_url":"https://codeload.github.com/tidwall/hashmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidwall%2Fhashmap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268266962,"owners_count":24222769,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hash","hashmap","hashtable","map","table"],"created_at":"2024-08-04T04:01:21.394Z","updated_at":"2025-08-01T17:34:31.537Z","avatar_url":"https://github.com/tidwall.png","language":"Go","readme":"# hashmap\n\n[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/tidwall/hashmap)\n\nAn [efficient](BENCH.md) hashmap implementation in Go.\n\n## Features\n\n- Support for [Generics](#generics).\n- `Map` and `Set` types for unordered key-value maps and sets,\n- [xxh3 algorithm](https://github.com/zeebo/xxh3)\n- [Open addressing](https://en.wikipedia.org/wiki/Hash_table#Open_addressing) with [Robin hood hashing](https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing)\n- Automatically shinks memory on deletes (no memory leaks).\n- Pretty darn good performance. 🚀 ([benchmarks](BENCH.md)).\n\nFor ordered key-value data, check out the [tidwall/btree](https://github.com/tidwall/btree) package.\n\n## Getting Started\n\n### Installing\n\nTo start using `hashmap`, install Go and run `go get`:\n\n```sh\ngo get github.com/tidwall/hashmap\n```\n\nThis will retrieve the library.\n\n## Usage\n\nThe `Map` type works similar to a standard Go map, and includes the methods:\n`Set`, `Get`, `Delete`, `Len`, `Scan`, `Keys`, `Values`, and `Copy`.\n\n```go\nvar m hashmap.Map[string, string]\nm.Set(\"Hello\", \"Dolly!\")\nval, _ := m.Get(\"Hello\")\nfmt.Printf(\"%v\\n\", val)\nval, _ = m.Delete(\"Hello\")\nfmt.Printf(\"%v\\n\", val)\nval, _ = m.Get(\"Hello\")\nfmt.Printf(\"%v\\n\", val)\n\n// Output:\n// Dolly!\n// Dolly!\n//\n```\n\nThe `Set` type is like `Map` but only for keys.\nIt includes the methods: `Insert`, `Contains`, `Delete`, `Len`, `Scan` and `Keys`.\n\n```go\nvar m hashmap.Set[string]\nm.Insert(\"Andy\")\nm.Insert(\"Kate\")\nm.Insert(\"Janet\")\n\nfmt.Printf(\"%v\\n\", m.Contains(\"Kate\"))\nfmt.Printf(\"%v\\n\", m.Contains(\"Bob\"))\nfmt.Printf(\"%v\\n\", m.Contains(\"Andy\"))\n\n// Output:\n// true\n// false\n// true\n```\n\n## Performance\n\nSee [BENCH.md](BENCH.md) for more info.\n\n## Contact\n\nJosh Baker [@tidwall](http://twitter.com/tidwall)\n\n## License\n\nSource code is available under the MIT [License](LICENSE).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidwall%2Fhashmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidwall%2Fhashmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidwall%2Fhashmap/lists"}