{"id":45653426,"url":"https://github.com/sysrqmagician/bittenhumans","last_synced_at":"2026-02-24T07:17:09.257Z","repository":{"id":286335019,"uuid":"961113856","full_name":"sysrqmagician/bittenhumans","owner":"sysrqmagician","description":"A lightweight, simple byte size humanization library for Rust.","archived":false,"fork":false,"pushed_at":"2025-10-16T04:50:34.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-22T09:02:14.897Z","etag":null,"topics":["file-size","humanization","library"],"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/sysrqmagician.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"sysrqmagician","thanks_dev":null,"custom":null}},"created_at":"2025-04-05T19:29:40.000Z","updated_at":"2025-10-16T04:50:38.000Z","dependencies_parsed_at":"2025-04-05T20:01:33.575Z","dependency_job_id":"6686e9d9-7586-42fa-8962-f9a1d995acd2","html_url":"https://github.com/sysrqmagician/bittenhumans","commit_stats":null,"previous_names":["sysrqmagician/bittenhumans"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sysrqmagician/bittenhumans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysrqmagician%2Fbittenhumans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysrqmagician%2Fbittenhumans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysrqmagician%2Fbittenhumans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysrqmagician%2Fbittenhumans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysrqmagician","download_url":"https://codeload.github.com/sysrqmagician/bittenhumans/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysrqmagician%2Fbittenhumans/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29774547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["file-size","humanization","library"],"created_at":"2026-02-24T07:17:05.236Z","updated_at":"2026-02-24T07:17:09.253Z","avatar_url":"https://github.com/sysrqmagician.png","language":"Rust","funding_links":["https://buymeacoffee.com/sysrqmagician"],"categories":[],"sub_categories":[],"readme":"# bittenhumans\n\n[![Crates.io](https://img.shields.io/crates/v/bittenhumans)](https://crates.io/crates/bittenhumans)\n![Crates.io](https://img.shields.io/crates/l/bittenhumans)\n[![Docs.rs](https://docs.rs/bittenhumans/badge.svg)](https://docs.rs/bittenhumans)\n\nA lightweight, simple byte size humanization library for Rust.\n\n## Features\n\n- Basic humanization, supporting both **decimal** (KB, MB, GB) and **binary** (KiB, MiB, GiB) numeral systems\n- Automatically fit values and reuse formatters\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nbittenhumans = \"1.0.0\"\n```\n\n## Usage\n\n### Basic Usage\n\n```rust\nuse bittenhumans::ByteSizeFormatter;\nuse bittenhumans::consts::System;\n\nfn main() {\n    // Format with automatic unit selection\n    let formatted = ByteSizeFormatter::format_auto(1_500_000, System::Decimal);\n    assert_eq!(formatted, \"1.50 MB\");\n\n    // Format using binary system (powers of 1024)\n    let formatted = ByteSizeFormatter::format_auto(1_500_000, System::Binary);\n    assert_eq!(formatted, \"1.43 MiB\");\n}\n```\n\n### Creating Reusable Formatters\n\n```rust\nuse bittenhumans::ByteSizeFormatter;\nuse bittenhumans::consts::{Magnitude, System};\n\nfn main() {\n    // Create a formatter for gigabytes\n    let gb_formatter = ByteSizeFormatter::new(System::Decimal, Magnitude::Giga);\n\n    // Use it multiple times with different values\n    let total_space = gb_formatter.format_value(1_000_000_000_000); // \"1000.00 GB\"\n    let free_space = gb_formatter.format_value(250_000_000_000); // \"250.00 GB\"\n}\n```\n\n### Creating Size-Appropriate Formatters\n\n```rust\nuse bittenhumans::ByteSizeFormatter;\nuse bittenhumans::consts::System;\n\nfn main() {\n    // Create a formatter that fits the largest value you'll format\n    let disk_size = 2_000_000_000_000; // 2 TB\n    let formatter = ByteSizeFormatter::fit(disk_size, System::Binary);\n\n    // All values will use the same unit for consistent display\n    println!(\"Disk size: {}\", formatter.format_value(disk_size));     // \"1.82 TiB\"\n    println!(\"Used space: {}\", formatter.format_value(disk_size/4));  // \"0.45 TiB\"\n}\n```\n\n## Documentation\n\nFor more detailed information, check the [API documentation](https://docs.rs/bittenhumans).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysrqmagician%2Fbittenhumans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysrqmagician%2Fbittenhumans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysrqmagician%2Fbittenhumans/lists"}