{"id":23672747,"url":"https://github.com/stepainpy/uintn_t","last_synced_at":"2025-10-31T05:35:38.691Z","repository":{"id":270087201,"uuid":"909289764","full_name":"Stepainpy/uintN_t","owner":"Stepainpy","description":"uintN_t - integer type for large numbers with fixed width","archived":false,"fork":false,"pushed_at":"2025-01-12T18:07:12.000Z","size":169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T19:21:43.643Z","etag":null,"topics":["algorithms","compile-time","constexpr","cpp11","fixed-width","header-only","integer","integer-arithmetic","long-arithmetics"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Stepainpy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-28T08:56:42.000Z","updated_at":"2025-01-12T18:07:15.000Z","dependencies_parsed_at":"2025-01-12T19:32:32.498Z","dependency_job_id":null,"html_url":"https://github.com/Stepainpy/uintN_t","commit_stats":null,"previous_names":["stepainpy/uintn_t"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2FuintN_t","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2FuintN_t/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2FuintN_t/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2FuintN_t/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stepainpy","download_url":"https://codeload.github.com/Stepainpy/uintN_t/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239699420,"owners_count":19682537,"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":["algorithms","compile-time","constexpr","cpp11","fixed-width","header-only","integer","integer-arithmetic","long-arithmetics"],"created_at":"2024-12-29T11:18:33.857Z","updated_at":"2025-10-31T05:35:33.656Z","avatar_url":"https://github.com/Stepainpy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\n`uintN_t` is a type used to represent a large unsigned integer with a fixed number of bits.\nImplement all base operations for integers (`+`, `-`, `*` and etc.).\n\n## Using in project\n\nJust include the file `uintN_t.hpp`.  \nCreate a variable with type uintN_t\u003c*bits*, *digit*\u003e\nor use base size aliases (uint*X*_t, *X* = 128, 256, 512, 1024)\nwhere:\n- *bits* - integer width (8, 16, 32, 64, 128, 256, etc.)\n- *digit* - unsigned integer type for represent digit (width equal 8, 16, 32 and 64[^1])\n\nWays of create object:\n- using literal suffix `_Ui` + *bits* from namespace `uintN_t_literals`\n- initialize with `{0, 0, ...}` i.e. array of digits (C++14 and later)\n- create from 'short' number or array of digits with use `create_uintN_t` with template parameter of *bits* and *digit*\n- using string [conversions](#Conversions)\n\n## Example\n\n``` cpp\n#include \"uintN_t.hpp\"\n#include \u003ciostream\u003e\nusing namespace uintN_t_literals;\n\nint main() {\n    auto n = 12345_Ui128;\n    // or n = uintN_t\u003c128, uint32_t\u003e{12345}\n    // or n = create_uintN_t\u003c128, uint32_t\u003e(12345)\n    std::cout \u003c\u003c n \u003c\u003c '\\n';\n}\n```\n\n## Standard library support\n\n- `std::numeric_limits`\n- `std::hash`\n- `std::to_string`\n- `std::strtoumax`[^2]\n- `std::to_chars`\n- `std::from_chars`\n- `std::ostream.operator\u003c\u003c`\n- `std::istream.operator\u003e\u003e`\n- `std::swap`\n\n## Conversions\n\n- to `bool`\n- to `digit_t` (explicit)\n- to `extend_digit_t` (explicit)\n- to `uintN_t` with greater width\n- to `uintN_t` with less width (explicit)\n- to `uintN_t` with same width and other digit type by `to_another_digits`\n- to string by `std::to_string` or `std::to_chars` or `std::ostream`\n- from string by `std::strtoumax` or `std::from_chars` or `std::istream`\n\n## TODO\n\n- [x] Add support for C++11\n- [x] Add literal check in operator\n- [ ] Full implement Toom-Cook algorithm with k = 4\n- [x] Add conversion from string or istream\n- [x] Add support of different digit type\n\n[^1]: If your compiler support `__uint128_t` and macros `__SIZEOF_INT128__`\n[^2]: Overloaded by template parameter","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepainpy%2Fuintn_t","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepainpy%2Fuintn_t","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepainpy%2Fuintn_t/lists"}