{"id":15049543,"url":"https://github.com/sunsided/stdint-rs","last_synced_at":"2025-10-04T10:31:11.046Z","repository":{"id":65045769,"uuid":"580542742","full_name":"sunsided/stdint-rs","owner":"sunsided","description":"C99 stdint types such as uint_fast8_t for performance and interoperability.","archived":false,"fork":true,"pushed_at":"2022-12-27T14:38:10.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-26T02:03:13.921Z","etag":null,"topics":["c99","no-std","rust","stdint"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/stdint","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"vojtechkral/rust-c99","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.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}},"created_at":"2022-12-20T20:27:38.000Z","updated_at":"2022-12-27T14:38:43.000Z","dependencies_parsed_at":"2023-01-31T03:30:17.188Z","dependency_job_id":null,"html_url":"https://github.com/sunsided/stdint-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fstdint-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fstdint-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fstdint-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fstdint-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/stdint-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235238315,"owners_count":18958075,"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":["c99","no-std","rust","stdint"],"created_at":"2024-09-24T21:21:13.394Z","updated_at":"2025-10-04T10:31:10.676Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## stdint\n\nProvides C99 integer types such as `uint_fast16_t`, `uint_least16_t` etc. for interfacing with\nC libraries that use them in both standard and `no_std` environments. Inspired by Vojtech Kral's [C99](https://github.com/vojtechkral/rust-c99) crate.\n\nThe library defaults to use the `std` crate. You can therefore\nsimply add the dependency to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nstdint = \"*\"\n```\n\nTo use the library in `no_std` environment, disable the use of\ndefault features:\n\n```toml\n[dependencies]\nstdint = { version = \"*\", default-features = false }\n```\n\nNote that the specific type aliases depend on your target architecture. On [docs.rs](https://docs.rs/stdint/0.1.0/stdint/type.int_fast16_t.html),\nthe `int_fast16_t` type is currently shown as aliased to an `std::ffi::c_long`; this is an artifact\nof the documentation generator:\n\n```rust\npub type int_fast16_t = c_long;\n```\n\nThe actual guarantees are:\n\n```rust\n#[test]\nfn int16() {\n    assert_eq!(size_of::\u003cint16_t\u003e(), 2);\n    assert!(size_of::\u003cint_least16_t\u003e() \u003e= 2);\n    assert!(size_of::\u003cint_fast16_t\u003e() \u003e= 2);\n\n    assert_eq!(size_of::\u003cuint16_t\u003e(), 2);\n    assert!(size_of::\u003cuint_least16_t\u003e() \u003e= 2);\n    assert!(size_of::\u003cuint_fast16_t\u003e() \u003e= 2);\n}\n```\n\nTo execute the tests in `no_std` mode, run\n\n```shell\n$ cargo test --no-default-features\n```\n\n### Types of defined sizes\n\n| N    | Exact size (N bits)   | Smallest type with at least N bits | Fastest type with at least N bits |\n|------|-----------------------|------------------------------------|-----------------------------------|\n| `8`  | `int8_t`, `uint8_t`   | `int_least8_t`, `uint_least8_t`    | `int_fast8_t`, `uint_fast8_t`     |\n| `16` | `int16_t`, `uint16_t` | `int_least16_t`, `uint_least16_t`  | `int_fast16_t`, `uint_fast16_t`   |\n| `32` | `int32_t`, `uint32_t` | `int_least32_t`, `uint_least32_t`  | `int_fast32_t`, `uint_fast32_t`   |\n| `64` | `int64_t`, `uint64_t` | `int_least64_t`, `uint_least64_t`  | `int_fast64_t`, `uint_fast64_t`   |\n\n### Special types\n\n| Type                    | Purpose                         |\n|-------------------------|---------------------------------|\n| `intptr_t`, `uintptr_t` | Type capable of holding `*void` |\n| `intmax_t`, `uintmax_t` | Largest integer type available  |\n\n### Constants\n\nAccording `MIN` and `MAX` constants defined in `stdint.h` are exposed through\nthe `consts` module such as `INT_FAST16_MIN` and `INT_FAST16_MAX`. Due to Rust's type system,\nthese value are identical to `int_fast16_t::MIN` and `int_fast16_t::MAX`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fstdint-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fstdint-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fstdint-rs/lists"}