{"id":18084950,"url":"https://github.com/jwodder/strtoint","last_synced_at":"2025-04-12T20:10:10.471Z","repository":{"id":62707719,"uuid":"561842253","full_name":"jwodder/strtoint","owner":"jwodder","description":"Parse integers from strings, with support for base prefixes","archived":false,"fork":false,"pushed_at":"2025-02-09T21:51:00.000Z","size":58,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T20:10:03.598Z","etag":null,"topics":["available-on-crates-io","binary","hexadecimal","int","octal","parse-int","rust"],"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/jwodder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-11-04T16:01:57.000Z","updated_at":"2025-02-09T21:51:02.000Z","dependencies_parsed_at":"2023-12-07T23:24:29.768Z","dependency_job_id":"67f2cb4b-f568-42ff-9579-602bee5854e3","html_url":"https://github.com/jwodder/strtoint","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"79e34509c482a4243b8c926bf962c2af8e5da61b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fstrtoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fstrtoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fstrtoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fstrtoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwodder","download_url":"https://codeload.github.com/jwodder/strtoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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":["available-on-crates-io","binary","hexadecimal","int","octal","parse-int","rust"],"created_at":"2024-10-31T15:08:45.104Z","updated_at":"2025-04-12T20:10:10.445Z","avatar_url":"https://github.com/jwodder.png","language":"Rust","readme":"[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CI Status](https://github.com/jwodder/strtoint/actions/workflows/test.yml/badge.svg)](https://github.com/jwodder/strtoint/actions/workflows/test.yml)\n[![codecov.io](https://codecov.io/gh/jwodder/strtoint/branch/master/graph/badge.svg)](https://codecov.io/gh/jwodder/strtoint)\n[![Minimum Supported Rust Version](https://img.shields.io/badge/MSRV-1.56-orange)](https://www.rust-lang.org)\n[![MIT License](https://img.shields.io/github/license/jwodder/strtoint.svg)](https://opensource.org/licenses/MIT)\n\n[GitHub](https://github.com/jwodder/strtoint) | [crates.io](https://crates.io/crates/strtoint) | [Documentation](https://docs.rs/strtoint) | [Issues](https://github.com/jwodder/strtoint/issues) | [Changelog](https://github.com/jwodder/strtoint/blob/master/CHANGELOG.md)\n\n`strtoint` provides a function of the same name for parsing integer literals\nfrom strings, with support for the base prefixes `0x`, `0o`, and `0b` for\nhexadecimal, octal, and binary literals, respectively.\n\nThis crate supports parsing into all primitive integer types built into Rust,\nalong with their \"NonZero\" equivalents.\n\nIf the `std` feature (enabled by default) is disabled, this crate will be built\nin no-std mode.  The only difference is that `StrToIntError` only implements\nthe `std::error::Error` trait under `std`.\n\nExamples\n========\n\n```rust\nuse core::num::NonZeroUsize;\nuse strtoint::strtoint;\n\nassert_eq!(strtoint::\u003ci32\u003e(\"123\").unwrap(), 123);\nassert_eq!(strtoint::\u003cu32\u003e(\"0xabcd_FFFF\").unwrap(), 2882404351);\nassert_eq!(strtoint::\u003ci16\u003e(\"0o644\").unwrap(), 420);\nassert_eq!(strtoint::\u003ci8\u003e(\"-0b00101010\").unwrap(), -42);\nassert!(strtoint::\u003ci64\u003e(\"42.0\").is_err());\n\nassert_eq!(\n    strtoint::\u003cNonZeroUsize\u003e(\"123_456\").unwrap(),\n    NonZeroUsize::new(123456).unwrap()\n);\nassert!(strtoint::\u003cNonZeroUsize\u003e(\"0\").is_err());\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fstrtoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwodder%2Fstrtoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fstrtoint/lists"}