{"id":18805648,"url":"https://github.com/phorward/num-parse","last_synced_at":"2026-02-08T00:33:22.789Z","repository":{"id":42017494,"uuid":"508313929","full_name":"phorward/num-parse","owner":"phorward","description":"Generic, JavaScript-like parseInt() and parseFloat() functions for Rust.","archived":false,"fork":false,"pushed_at":"2024-11-02T00:09:15.000Z","size":34,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T07:56:05.747Z","etag":null,"topics":["javascript-style","parseint","rust-lang"],"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/phorward.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-28T13:37:07.000Z","updated_at":"2024-10-02T00:12:12.000Z","dependencies_parsed_at":"2024-11-07T22:44:42.845Z","dependency_job_id":"e4bb99ec-8df2-4a38-a49e-57a935bba01a","html_url":"https://github.com/phorward/num-parse","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"c35430706232d85c5a0cd880b3f8b6e9c57894ab"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/phorward/num-parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Fnum-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Fnum-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Fnum-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Fnum-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phorward","download_url":"https://codeload.github.com/phorward/num-parse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phorward%2Fnum-parse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29214394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T00:10:47.190Z","status":"ssl_error","status_checked_at":"2026-02-08T00:10:43.589Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["javascript-style","parseint","rust-lang"],"created_at":"2024-11-07T22:44:36.333Z","updated_at":"2026-02-08T00:33:22.761Z","avatar_url":"https://github.com/phorward.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# num-parse\n\n[![Build status](https://github.com/phorward/num-parse/actions/workflows/main.yml/badge.svg)](https://github.com/phorward/num-parse/actions/workflows/main.yml)\n[![docs.rs](https://img.shields.io/docsrs/num-parse)](https://docs.rs/num-parse/latest/num_parse/)\n[![crates.io](https://img.shields.io/crates/v/num-parse)](https://crates.io/crates/num-parse)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nGeneric, JavaScript-like parseInt() functions for Rust.\n\nThis crate is intended to provide a fast and generic `parseInt()`-like implementation for Rust, which mostly follows the specification described in the [MDN parseInt() documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt).\n\nLikewise in JavaScript, a `parseFloat()`-like implementation for float-types is planned as well, therefore the crate has been named `num-parse` already, althought it currently provides `parse_int()` and variative functions only.\n\n## parse_int(), parse_uint()\n\n`parse_int()` and `parse_uint()` are generic interfaces to parse integers from string. Whitespace in front of the parsed number is being ignored, same as anything beyond a valid number.\n\n```rust\nuse num_parse::*;\n\nassert_eq!(parse_uint::\u003ci32\u003e(\"+123 as i32 \"), Some(123i32));\nassert_eq!(parse_int::\u003ci32\u003e(\" -123 as i32 \"), Some(-123i32));\nassert_eq!(parse_uint::\u003ci64\u003e(\"+123 as i64 \"), Some(123i64));\nassert_eq!(parse_int::\u003ci64\u003e(\" -123 as i64 \"), Some(-123i64));\n\nassert_eq!(parse_int::\u003ci64\u003e(\" - 1 is invalid \"), None);\nassert_eq!(\n    parse_uint::\u003cu64\u003e(\" -123 as u64, parse_int() not available for this type \"),\n    None\n);\nassert_eq!(\n    parse_uint::\u003cusize\u003e(\" 0xcafebabe triggers hex-mode parsing \"),\n    Some(3405691582usize)\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphorward%2Fnum-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphorward%2Fnum-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphorward%2Fnum-parse/lists"}