{"id":13648782,"url":"https://github.com/hroi/treebitmap","last_synced_at":"2025-12-30T04:32:00.845Z","repository":{"id":45180816,"uuid":"50311253","full_name":"hroi/treebitmap","owner":"hroi","description":"Fast IP lookup table for IPv4/IPv6 prefixes","archived":true,"fork":false,"pushed_at":"2021-03-09T00:30:41.000Z","size":106,"stargazers_count":98,"open_issues_count":8,"forks_count":32,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-09T23:36:21.110Z","etag":null,"topics":["datastructures","ipv4","ipv6","lookup-table","subnetting","trie"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/hroi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-24T22:22:56.000Z","updated_at":"2024-11-08T09:24:33.000Z","dependencies_parsed_at":"2022-07-26T16:32:01.635Z","dependency_job_id":null,"html_url":"https://github.com/hroi/treebitmap","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hroi%2Ftreebitmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hroi%2Ftreebitmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hroi%2Ftreebitmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hroi%2Ftreebitmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hroi","download_url":"https://codeload.github.com/hroi/treebitmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250232532,"owners_count":21396660,"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":["datastructures","ipv4","ipv6","lookup-table","subnetting","trie"],"created_at":"2024-08-02T01:04:32.316Z","updated_at":"2025-12-12T15:04:09.108Z","avatar_url":"https://github.com/hroi.png","language":"Rust","readme":"# Tree-Bitmap: Fast lookup table for IPv4/IPv6 prefixes\n\nThis crate provides a datastructure for fast IP address lookups.\nIt aims at fast lookup times, and a reasonable memory footprint.\n\nThe internal datastructure is based on the Tree-bitmap algorithm described by\nW. Eatherton, Z. Dittia, G. Varghes.\n\n## Documentation\n\nRustdoc: https://docs.rs/treebitmap/\n\n## Illustration\nAn example illustration of a trie representing a routing table containing\n```0.0.0.0/0``` (foo), ```10.0.0.0/8``` (bar), ```172.16.0.0/12``` (baz) and\n```192.168.0.0/16``` (quux).\n\n![rfc1918 trie illustration](https://hroi.github.io/rfc1918.svg)\n\n## Internal trie datastructure basics\n```Node ``` encodes result and child node pointers in a bitmap.\n\nA trie node can encode up to 31 results when acting as an \"end node\", or 15\nresults and 16 children/subtrees when acting as a normal/internal node.\n\nEach bit in the bitmap indicates a bit matching pattern:\n\n| bit   | 0 |  1 |  2 |  3  |   4 |   5 |   6 |    7 |\n|-------|---|----|----|-----|-----|-----|-----|------|\n| match | * | 0* | 1* | 00* | 01* | 10* | 11* | 000* |\n\n| bit   |    8 |    9 |   10 |   11 |   12 |   13 |   14 |          15 |\n|-------|------|------|------|------|------|------|------|-------------|\n| match | 001* | 010* | 011* | 100* | 101* | 110* | 111* | endnode-bit |\n\nThe last bit here does not indicate a pattern. It instead indicates if this\nnode is an \"end node\". End nodes carry double the amount of results but can't\nencode any child pointers.\n\n| bit   |    16 |    17 |    18 |    19 |    20 |    21 |    22 |    23 |\n|-------|-------|-------|-------|-------|-------|-------|-------|-------|\n| match | 0000* | 0001* | 0010* | 0011* | 0100* | 0101* | 0110* | 0111* |\n\n| bit   |    24 |    25 |    26 |    27 |    28 |    29 |    30 |    31 |\n|-------|-------|-------|-------|-------|-------|-------|-------|-------|\n| match | 1000* | 1001* | 1010* | 1011* | 1100* | 1101* | 1110* | 1111* |\n\nThe location of the result value is computed by adding the ```result_ptr``` base\npointer and its position among set bits.\n\nIf the endnode bit is not set, the last 16 bits encodes pointers to child\nnodes.\nIf bit N is set it means that a child node with segment value N is present.\nThe pointer to the child node is then computed by adding the ```child_ptr``` base\npointer and its position among set bits.\n\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhroi%2Ftreebitmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhroi%2Ftreebitmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhroi%2Ftreebitmap/lists"}