{"id":22970854,"url":"https://github.com/fbernier/base62","last_synced_at":"2025-08-13T11:33:55.246Z","repository":{"id":1759915,"uuid":"44154404","full_name":"fbernier/base62","owner":"fbernier","description":"Base62 encoding/decoding library in Rust","archived":false,"fork":false,"pushed_at":"2023-05-01T02:37:56.000Z","size":50,"stargazers_count":21,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T00:27:37.142Z","etag":null,"topics":[],"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/fbernier.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}},"created_at":"2015-10-13T05:36:55.000Z","updated_at":"2024-07-27T09:28:23.000Z","dependencies_parsed_at":"2023-07-05T18:49:30.753Z","dependency_job_id":null,"html_url":"https://github.com/fbernier/base62","commit_stats":{"total_commits":70,"total_committers":4,"mean_commits":17.5,"dds":0.4285714285714286,"last_synced_commit":"2160b92deb9a6b1eb76dc3d9c386b66b85bea6a8"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbernier%2Fbase62","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbernier%2Fbase62/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbernier%2Fbase62/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbernier%2Fbase62/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbernier","download_url":"https://codeload.github.com/fbernier/base62/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229759828,"owners_count":18119874,"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":[],"created_at":"2024-12-14T22:14:48.939Z","updated_at":"2025-08-13T11:33:55.226Z","avatar_url":"https://github.com/fbernier.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base62\n\nA fast, zero-dependency base62 encoder/decoder library for Rust, typically used in URL shorteners. It supports both standard [0-9A-Za-z] and alternative [0-9a-zA-Z] variants.\n\n[![Build status](https://github.com/fbernier/base62/workflows/ci/badge.svg)](https://github.com/fbernier/base62/actions)\n[![Crates.io](https://img.shields.io/crates/v/base62.svg)](https://crates.io/crates/base62)\n[![Docs](https://docs.rs/base62/badge.svg)](https://docs.rs/base62)\n\n## Features\n\n- `no_std` compatible with optional `alloc` and `std` support\n- Encodes integers up to `u128`\n- Zero-copy decoding\n- Efficient string handling\n- Two encoding variants:\n  - Standard [0-9A-Za-z]\n  - Alternative [0-9a-zA-Z]\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n```toml\n[dependencies]\nbase62 = \"2\"\n```\n\n### Basic Example\n\n```rust\nuse base62;\n\n// Encoding\nlet encoded = base62::encode(1234567890);\nassert_eq!(encoded, \"1LY7VK\");\n\n// Decoding\nlet decoded = base62::decode(\"1LY7VK\").unwrap();\nassert_eq!(decoded, 1234567890);\n```\n\n### No-std Usage\n\nThe crate works in `no_std` environments by default:\n\n```rust\n#![no_std]\nuse base62;\n\n// Encode into a fixed buffer\nlet mut buf = [0u8; 22];  // Maximum size needed for u128\nlet len = base62::encode_bytes(1234567890, \u0026mut buf).unwrap();\nassert_eq!(\u0026buf[..len], b\"1LY7VK\");\n\n// Decode from bytes\nlet decoded = base62::decode(\u0026buf[..len]).unwrap();\nassert_eq!(decoded, 1234567890);\n```\n\n## Feature Flags\n\n- `alloc`: Enables String allocation support (enabled by default)\n- `std`: Enables std::io traits support\n\n## Performance\n\nThe library is optimized for both encoding and decoding performance:\n- Zero-copy decoding\n- Efficient buffer management\n- Direct string manipulation for optimal performance when appending\n\n## License\n\nLicensed under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbernier%2Fbase62","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbernier%2Fbase62","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbernier%2Fbase62/lists"}