{"id":15069487,"url":"https://github.com/nervous-systems/java-unsigned-integers","last_synced_at":"2026-04-08T14:32:37.184Z","repository":{"id":57735920,"uuid":"107881111","full_name":"nervous-systems/java-unsigned-integers","owner":"nervous-systems","description":"Optimized, immutable Java implementations of fixed-width, unsigned integers.","archived":false,"fork":false,"pushed_at":"2023-01-15T18:39:12.000Z","size":630,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-20T11:47:50.585Z","etag":null,"topics":["biginteger","cryptography","java","java-8","math","openjdk"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nervous-systems.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}},"created_at":"2017-10-22T16:03:06.000Z","updated_at":"2024-12-03T00:56:40.000Z","dependencies_parsed_at":"2023-02-09T23:15:46.463Z","dependency_job_id":null,"html_url":"https://github.com/nervous-systems/java-unsigned-integers","commit_stats":null,"previous_names":["nervous-systems/juint"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nervous-systems/java-unsigned-integers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervous-systems%2Fjava-unsigned-integers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervous-systems%2Fjava-unsigned-integers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervous-systems%2Fjava-unsigned-integers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervous-systems%2Fjava-unsigned-integers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nervous-systems","download_url":"https://codeload.github.com/nervous-systems/java-unsigned-integers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervous-systems%2Fjava-unsigned-integers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31559811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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":["biginteger","cryptography","java","java-8","math","openjdk"],"created_at":"2024-09-25T01:42:49.966Z","updated_at":"2026-04-08T14:32:37.156Z","avatar_url":"https://github.com/nervous-systems.png","language":"Java","readme":"# JUInt [![CircleCI](https://circleci.com/gh/nervous-systems/juint/tree/master.png?style=shield\u0026circle-token=6f13ee621838019658e21ab69a65f3fe7743401f)](https://circleci.com/gh/nervous-systems/juint/tree/master) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.nervous/juint/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.nervous/juint)\n\nOptimized, immutable Java implementations of fixed-width, unsigned integers.\nCurrently 128 bit\n([UInt128](https://nervous.io/doc/juint/io/nervous/juint/UInt128.html)) and 256\nbit ([UInt256](https://nervous.io/doc/juint/io/nervous/juint/UInt256.html))\nvariants are available (with identical, `BigInteger`-style interfaces). It'd be\ntrivial to offer differently sized integers with the same semantics, as all\noperations are implemented statically in terms of arrays.\n\n`juint` requires Java 8.\n\n## Documentation\n### Javadoc\n - [UInt128](https://nervous.io/doc/juint/io/nervous/juint/UInt128.html)\n - [UInt256](https://nervous.io/doc/juint/io/nervous/juint/UInt256.html)\n\n## Performance\n\nIgnoring constant overhead, per-instance memory consumption is identical to\n`BigInteger`'s best case - i.e. an array holding the minimum number of integers\nrequired to represent a given number - never zero prefixed.\n\nOperation throughput is expected to be significantly higher than OpenJDK's\n`BigInteger` for most operations (often dramatically so). There are exhaustive\n(around 170) JMH micro-benchmarks per operation \u0026 magnitude in the `bench`\nsubproject.\n\n![graph](static/uint256.png)\n\nand some updated 2023 benchmarks:\n\n![graph](static/uint256-2023.png)\n\n![graph](static/uint256-tuweni.png)\n\nEach operation's bar represents the average throughput across all of its\nmagnitude-specific benchmark cases, relative to identical benchmarks which\noperate on `BigInteger`. Typically, in the case of `UInt256`, there'd be\nseparate cases for one word, two words, four words (half) and 8 words (full),\neach operating on a range of similarly wide values.\n\nErring on the side of fairness, the `BigInteger` reference benchmarks only\ninclude the cost of constraining the result within the maximum width if the\noperation _will definitely_ overflow. As this approach requires a degree of\nforeknowledge present in few real-life use cases, relative throughput\nmay be significantly improved from that depicted.\n\nThe `multiply` disparity above is due to HotSpot's intrinsification of\n`BigInteger.multiplyToLen`, a private method used by `BigInteger.multiply` (and\n`pow`, by association) - obviously not an optimization strategy available to\nlibrary code.\n\n## License\n\nLike OpenJDK itself, `juint` is distributed under the terms of the _GNU General\nPublic License_ (version 2) **with the classpath exception**:\n\n\u003e ...The copyright holders of this library give you permission to link this\n\u003e library with independent modules to produce an executable, regardless of the\n\u003e license terms of these independent modules...\n\nPlease see the accompanying `LICENSE` file for details.\n\n### GPL Notes\n\nAs mentioned, `juint` offers an interface compatible with `BigInteger`, and\nfollows a similar strategy to OpenJDK for division and the `(String, int)`\nconstructor.  While I don't consider it a _derived work_, I don't want to have\nto explain that to Gavin Belson in a courtroom.\n\nDespite a strong personal preference for Public Domain software, retaining\nOpenJDK's license seems the prudent choice, and doesn't place additional burden\non those consuming this project.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervous-systems%2Fjava-unsigned-integers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervous-systems%2Fjava-unsigned-integers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervous-systems%2Fjava-unsigned-integers/lists"}