{"id":17998102,"url":"https://github.com/cookiengineer/golpm","last_synced_at":"2025-04-04T06:25:20.942Z","repository":{"id":223065197,"uuid":"758862648","full_name":"cookiengineer/golpm","owner":"cookiengineer","description":":rocket: LPM Tries and Hash Set Maps for Go","archived":false,"fork":false,"pushed_at":"2024-02-17T12:40:38.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T12:11:35.328Z","etag":null,"topics":["data-structures-and-algorithms","go","golang","longest-prefix-match","lpm-hashmap","lpm-trie"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cookiengineer.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":"2024-02-17T09:52:25.000Z","updated_at":"2024-10-16T17:14:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"8be511c3-504d-479d-b431-abfefa589257","html_url":"https://github.com/cookiengineer/golpm","commit_stats":null,"previous_names":["cookiengineer/lpm","cookiengineer/golpm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiengineer%2Fgolpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiengineer%2Fgolpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiengineer%2Fgolpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cookiengineer%2Fgolpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cookiengineer","download_url":"https://codeload.github.com/cookiengineer/golpm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247130836,"owners_count":20888660,"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":["data-structures-and-algorithms","go","golang","longest-prefix-match","lpm-hashmap","lpm-trie"],"created_at":"2024-10-29T21:24:02.321Z","updated_at":"2025-04-04T06:25:20.913Z","avatar_url":"https://github.com/cookiengineer.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Go LPM Trie and Go LPM Hash Map Library\n\nThis is a standalone library that implements the `longest prefix match` algorithm\nfor use with `Subnets`, `CIDRs` and `IPs`. It supports both `IPv4` and `IPv6`\nprefix notations.\n\n\n## Usage\n\nThe [examples](/examples) folder contains usage examples.\n\nAs pointed out in my [Web Log article about LPM Tries](https://cookie.engineer/weblog/articles/you-dont-need-lpm-tries.html)\nit is heavily recommended to use the `HashMap` wherever possible, as it's the\nmost efficient way to represent a `longest prefix match` respecting data\nstructure.\n\n```go\nimport \"github.com/cookiengineer/lpm\"\nimport \"fmt\"\n\nhashmap := lpm.NewHashMap()\n\nhashmap.Insert(\"192.168.0.0/24\")\nhashmap.Insert(\"192.169.128.0/17\")\nhashmap.Insert(\"192.169.0.0/16\")\nhashmap.Insert(\"192.169.0.0/24\")\n\nfmt.Println(\"parent of 192.168.0.123 is:\", hashmap.Search(\"192.168.0.123/32\"))\nfmt.Println(\"parent of 192.169.0.123 is:\", hashmap.Search(\"192.169.0.123/32\"))\n\nfmt.Println(\"\")\nfmt.Println(\"hashmap:\")\nhashmap.Print()\n```\n\n\n## License\n\nAGPL3\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcookiengineer%2Fgolpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcookiengineer%2Fgolpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcookiengineer%2Fgolpm/lists"}