{"id":29822834,"url":"https://github.com/rockcavera/nim-nint128","last_synced_at":"2026-03-07T23:31:07.887Z","repository":{"id":170167030,"uuid":"341365078","full_name":"rockcavera/nim-nint128","owner":"rockcavera","description":"128-bit integers","archived":false,"fork":false,"pushed_at":"2024-03-21T03:37:41.000Z","size":95,"stargazers_count":35,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T01:15:56.636Z","etag":null,"topics":["int128","integer","integers","nim","uint128"],"latest_commit_sha":null,"homepage":"https://rockcavera.github.io/nim-nint128/nint128.html","language":"Nim","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/rockcavera.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":"2021-02-22T23:16:51.000Z","updated_at":"2025-03-22T01:50:06.000Z","dependencies_parsed_at":"2025-07-29T01:24:38.181Z","dependency_job_id":null,"html_url":"https://github.com/rockcavera/nim-nint128","commit_stats":null,"previous_names":["rockcavera/nim-nint128"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rockcavera/nim-nint128","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockcavera%2Fnim-nint128","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockcavera%2Fnim-nint128/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockcavera%2Fnim-nint128/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockcavera%2Fnim-nint128/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockcavera","download_url":"https://codeload.github.com/rockcavera/nim-nint128/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockcavera%2Fnim-nint128/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30237329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T23:24:20.706Z","status":"ssl_error","status_checked_at":"2026-03-07T23:21:10.486Z","response_time":53,"last_error":"SSL_read: 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":["int128","integer","integers","nim","uint128"],"created_at":"2025-07-29T01:09:37.484Z","updated_at":"2026-03-07T23:31:07.757Z","avatar_url":"https://github.com/rockcavera.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nint128, as the name suggests, is a package to work with integers, signed and unsigned, of 128 bits.\n\nCurrently the package implements 128-bit operations in pure Nim. Therefore, it is highly portable.\n\nFor optimizations, you can use, when possible, the C extension for 128-bit integers present in the GCC and CLANG compiler or VCC compiler intrinsics. For more information, see this [here](https://rockcavera.github.io/nim-nint128/nint128/nint128_cint128.html).\n\n# Status\nThe basic implementation is ready, but not fully tested. Visit the `tests` directory to see what has been tested and what remains to be tested.\n\nSome things may change and break down in the future.\n\n# Install\n`nimble install nint128`\n\nor\n\n`nimble install https://github.com/rockcavera/nim-nint128.git`\n\n# Basic Use\n```nim\nimport pkg/nint128\n\nconst\n  u999 = u128(\"0b1111100111\") ## Defines a constant from a binary string.\n  uHigh = u128(\"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\") ## Defines a constant from a hexadecimal string.\n  i333 = i128(\"0b101001101\") ## Defines a constant from a binary string.\n  iHigh = i128(\"0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\") ## Defines a constant from a hexadecimal string.\n\n## Comparisons `UInt128`\necho uHigh == high(UInt128)\necho uHigh != low(UInt128)\necho uHigh \u003e zero(UInt128)\necho uHigh \u003e= one(UInt128)\necho uHigh \u003c ten(UInt128)\necho uHigh \u003c= u999\n\n## Comparisons `Int128`\necho iHigh == high(Int128)\necho iHigh != low(Int128)\necho iHigh \u003e zero(Int128)\necho iHigh \u003e= one(Int128)\necho iHigh \u003c ten(Int128)\necho iHigh \u003c= i333\necho isNegative(iHigh)\n\n## Initialization of `UInt128` and `Int128` variables.\nvar\n  a, b: UInt128\n  c, d: Int128\n\na = u128(1234567890) ## Transforms the `int` `1234567890` into `UInt128`\nb = u128(\"18446744073709551616\") ## Transforms `string` `18446744073709551616` into `UInt128`\n\nc = i128(1234567890) ## Transforms the `int` `-13579` into `Int128`\nd = i128(\"-18446744073709551616\") ## Transforms `string` `-18446744073709551616` to `Int128`\n\n## Basic arithmetic `UInt128`\na = a + b\nb = b - u128(9223372036854775808'u64)\na = a * u999\nb = uHigh div a\nb = uHigh mod a\n(a, b) = divmod(uHigh, a)\n\n## Basic arithmetic `Int128`\nc = c + d\nd = d - i333\nc = c * i128(\"-3\")\nd = iHigh div c\nd = iHigh mod c\n(c, d) = divmod(iHigh, c)\n\n## Bitwise operation `UInt128`\na = a and b\na = a or b\na = a xor b\na = not(a)\na = a shl 12\nb = b shr 64\n\n## Bitwise operation `Int128`\nc = c and d\nc = c or d\nc = c xor d\nc = not(c)\nc = c shl 12\nd = d shr 64\n```\n\n# Documentation\nhttps://rockcavera.github.io/nim-nint128/theindex.html\n\n# License\n- The file `div2n1n.nim`, in the directory `src/nint128/vendor/stint/`, is authored by Status Research \u0026 Development GmbH, part of the stint package.\n- The file `endians2.nim`, in the directory `src/nint128/vendor/stew/`, is authored by Status Research \u0026 Development GmbH, part of the stew package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockcavera%2Fnim-nint128","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockcavera%2Fnim-nint128","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockcavera%2Fnim-nint128/lists"}