{"id":15653227,"url":"https://github.com/tomarrell/rust-elias-fano","last_synced_at":"2025-04-30T15:50:13.633Z","repository":{"id":57624173,"uuid":"140572308","full_name":"tomarrell/rust-elias-fano","owner":"tomarrell","description":"Elias-Fano encoding implementation in Rust","archived":false,"fork":false,"pushed_at":"2019-06-05T11:26:27.000Z","size":26,"stargazers_count":32,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T15:49:59.087Z","etag":null,"topics":["algorithm","compression","elias-fano","encoding","hacktoberfest","inverted-index","rust","search-algorithm"],"latest_commit_sha":null,"homepage":"","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/tomarrell.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}},"created_at":"2018-07-11T12:31:17.000Z","updated_at":"2025-04-30T09:56:41.000Z","dependencies_parsed_at":"2022-08-26T22:11:52.515Z","dependency_job_id":null,"html_url":"https://github.com/tomarrell/rust-elias-fano","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarrell%2Frust-elias-fano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarrell%2Frust-elias-fano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarrell%2Frust-elias-fano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarrell%2Frust-elias-fano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomarrell","download_url":"https://codeload.github.com/tomarrell/rust-elias-fano/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251734541,"owners_count":21635155,"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":["algorithm","compression","elias-fano","encoding","hacktoberfest","inverted-index","rust","search-algorithm"],"created_at":"2024-10-03T12:45:03.458Z","updated_at":"2025-04-30T15:50:13.598Z","avatar_url":"https://github.com/tomarrell.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elias-Fano, in Rust\n[![Build Status](https://img.shields.io/badge/crate-elias--fano-brightgreen.svg)](https://crates.io/crates/elias-fano)\n[![Rust Docs](https://img.shields.io/badge/docs.rs-elias--fano-orange.svg)](https://docs.rs/elias-fano)\n\nElias-Fano encoding in Rust.\n\nThe Elias-Fano encoding scheme is a quasi-succinct compression method for monotonic integers using gap compression on a Bitset. It allows for decompression of a bit at any position in `O(1)` time complexity.\n\nBeing quasi-succinct, it is therefore almost as good as the best theoretical possible compression as determined by the [Shannon-Hartley](https://en.wikipedia.org/wiki/Shannon%E2%80%93Hartley_theorem) theorem.\n\nThis implementation is based largely on one written in Go by [Antonio Mallia](https://www.antoniomallia.it/), which can be found at his repository [amallia/go-ef](https://github.com/amallia/go-ef).\n\n## Todo:\n- [x] Tests\n- [x] Example usage\n- [ ] Benchmarks, comparison with other implementations\n\n## Installation\nAdd the following line to your Cargo.toml:\n```diff\n[dependencies]\n+ elias-fano = \"1.1.0\"\n```\n\n## Example Usage\n```rust\nextern crate elias_fano;\n\nuse elias_fano::EliasFano;\n\nfn main() {\n    let sorted_array = [0, 3, 40, 1000];\n    let size = sorted_array.len();\n\n    let mut ef = EliasFano::new(sorted_array[size - 1], size as u64);\n\n    ef.compress(sorted_array.iter());\n\n    println!(\"{}\", ef.value()); // 1\n\n    match ef.next() {\n        Ok(val) =\u003e println!(\"Retrieved value: {}\", val), // 3\n        Err(error) =\u003e println!(\"Err: {}\", error),        // Out of bounds\n    }\n\n    let _ = ef.next();\n    println!(\"{}\", ef.value()); // 40\n\n    ef.reset();\n    println!(\"{}\", ef.value()); // 0\n\n    let _ = ef.visit(3);\n    println!(\"{}\", ef.value()); // 1000\n}\n```\n\n## License\nMIT licensed, see LICENSE for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarrell%2Frust-elias-fano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomarrell%2Frust-elias-fano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarrell%2Frust-elias-fano/lists"}