PackageTrack
Sign in Get early access

ruint

Unsigned integer type with const-generic bit length

1.20.0 26M downloads/mo #1832 most downloaded on crates.io alloy-rs/ruint

What this package is like to depend on

Last release 24 days ago

30 Jul 2026

Ships fairly regularly

a new release about every 2 months

Nearly every release is documented

notes for 35 of 35 stable releases

Nothing withdrawn

no release was ever pulled

4 years old

35 releases · first in 2022

6 releases in the last 12 months

see the full history below

Release timeline

35 releases · May 2022 to Jul 2026
2023 2024 2025 2026
Release Pre-release

Releases

latest 35
  1. 1.20.0 30 Jul 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.19.0...v1.20.0

    Open source →
    Release notes

    Changed

    • Open-code PartialEq and is_zero on riscv to avoid memcmp libcalls (#604)
    • Run the core test suite on wasm32-wasip1 in CI to catch 32-bit pointer-width bugs (#609)
    • Make reverse_bits, most_significant_bits, inv_ring, checked_pow, strict_pow, overflowing_pow, pow, saturating_pow, wrapping_pow, from_limbs_slice, checked_from_limbs_slice, wrapping_from_limbs_slice, overflowing_from_limbs_slice, saturating_from_limbs_slice, from_uint, and checked_from_uint const (#614)

    Fixed

    • Fix overflowing_shl/overflowing_shr overflow-flag false negatives, which also corrected the dependent checked_*/strict_*/saturating_* shifts and byte() (#603)
    • Fix from_str_radix rejecting the lowercase digits gz in radix 64 (#605)
    • Reject non-finite f64 in TryFrom<f64> and saturate Uintf64 conversions at 2^1024 for large BITS (#606)
    • try_from_be_slice/try_from_le_slice now return None instead of panicking for BITS % 64 in 57..=63 (#607)
    • from_str_radix and to_base_be no longer hang or silently accept radix/base 0 or 1 (#608)
    • checked_log, checked_log2, and checked_log10 no longer panic for small bit-widths where the base constant does not fit the type (#610)
    • Fix incorrect doc comments and formulas in the add, mul, and gcd algorithms (#611)
    • Mark addmul_nx1/submul_nx1 unsafe and close soundness / safety-contract gaps in the unstable algorithms module (#612)
    Open source →
  2. 1.19.0 03 Jul 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.18.0...v1.19.0

    Open source →
    Release notes

    Added

    Changed

    • Made from_str_radix const (#591)
    • Made multiplication functions const (#590)
    • Optimize Ord::cmp by comparing via subtraction (#579)
    • Optimize bit count helpers (leading/trailing zeros, count ones) (#578)
    • Optimize shift implementations (#574)

    Fixed

    • Fix to_be_bytes on big-endian platforms (#576)
    Open source →
  3. 1.18.0 22 Apr 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.17.2...v1.18.0

    Open source →
    Release notes

    Changed

    • Optimize from_str_radix (#557)
    • Specialize Ord::cmp, const_eq, const_is_zero for small sizes (#561)
    • Use bit shifts for power-of-two formatting (binary, octal, hex) instead of division (#565)
    • Optimize to_be_bytes for full-limb sizes via per-limb swap_bytes (#569)
    • Extract last iteration on mul loop to reduce register pressure (#566)

    Fixed

    • Use rkyv::primitive::ArchivedU64 (#556)
    Open source →
  4. 1.17.2 28 Dec 2025
    Release notes

    What's Changed

    Full Changelog: v1.17.1...v1.17.2

    Open source →
    Release notes

    Fixed

    • fix(docsrs): remove doc_auto_cfg (#554)
    Open source →
  5. 1.17.1 26 Dec 2025
    Release notes

    What's Changed

    • Fix codspeed benches & add most_significant_bits bench by @Evalir in #544
    • Fix codspeed benches & add most_significant_bits bench by @prestwich in #543
    • chore: update unsafe function and improve documentation and safety notes by @Evalir in #553
    • chore: update unsafe function and improve documentation and safety notes by @prestwich in #552

    Full Changelog: v1.17.0...v1.17.1

    Open source →
    Release notes

    Changed

    • Added unsafe to many unstable API functions in algorithms module, and documented their conditions of use (COU). (#552)
    Open source →
  6. 1.17.0 24 Sep 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.16.0...v1.17.0

    Open source →
    Release notes

    Added

    Changed

    • MSRV bumped to 1.85 (#503)
    • Made *next_power_of_two and *next_multiple_of const (#533)
    • Reimplemented TryFrom<f64> for Uint to speed it up, fixing edge cases and removing std requirements (#524)
    • Reimplemented From<Uint> for f64 and f32 to speed it up, fixing edge cases and removing std requirements ([#535])
    Open source →
  7. 1.16.0 04 Aug 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.15.0...v1.16.0

    Open source →
    Release notes

    Added

    • Support rkyv (#483)
    • Added bigdecimal support (#486)
    • PartialEq and PartialOrd implementations for primitive integers; minor breaking change for type inference (#491)

    Changed

    • to_base_be and core::fmt trait implementations are available without the "alloc" feature (#488)
    • Greatly improved performance across the board, mainly in: conversions, fmt, div/rem, mul, add_mod, leading_zeros

    Fixed

    • Check limb overflow in shift ops (#476)
    Open source →
  8. 1.15.0 22 May 2025
    Release notes

    What's Changed

    Full Changelog: v1.14.0...v1.15.0

    Open source →
    Release notes

    Added

    • Add const fn const_is_zero, const_eq, bit* (#441)

    Changed

    • Updated Pyo3. This is a non-semver breaking change to address a vulnerability reported on Pyo3. (#460)
    • Make rotate*, *sh[lr] functions const (#441)
    Open source →
  9. 1.14.0 25 Mar 2025
    Release notes

    What's Changed

    New Contributors

    • @kpp made their first contribution in #442

    Full Changelog: v1.13.1...v1.14.0

    Open source →
    Release notes

    Added

    • Add const not function (#442)
    • Make leading_zeros, leading_ones, count_ones, count_zeros, bit_len, byte_len, is_power_of_two functions const (#442)
    • random, random_with, randomize, randomize_with methods (#444)
    • rand 0.9 support (#445)
    • Add const ONE (#448)

    Changed

    • Update try_from_{b,l}e_slice documentation (#439)

    Fixed

    • Fix checked_byte bounds check and make it const (#438)
    Open source →
  10. 1.13.1 18 Feb 2025
    Release notes

    What's Changed

    Full Changelog: v1.13.0...v1.13.1

    Open source →
    Release notes

    Fixed

    • Remove unused hex dependencies which broke no_std (#433)
    Open source →
  11. 1.13.0 18 Feb 2025
    Release notes

    Added

    • Support for borsh @ 1.5 (#416)
    • copy_le_to_slice family to allow easier writing to pre-allocated buffers (#424)
    • add Uint::checked_byte(idx: usize) -> Option<u8> (#429)

    Changed

    • Unpin proptest (#426)

    Fixed

    • Update documentation related to Uint::byte and knuth divison (#429)
    • fix: swap bytes for as_le_bytes in big endian world (#431)
    Open source →
  12. 1.12.4 16 Dec 2024
    Release notes

    Added

    • Added Uint::square_redc. (#402)
    • Support for diesel @ 2.2 (#404)
    • Support for sqlx @ 0.8 (#400)
    • Support for fastrlp @ 0.4 (#401)
    • Added support for subtle and der (#399)

    Removed

    • Support for sqlx @ 0.7. This is a breaking change, outside of regular semver policy, as 0.7 contains a security vulnerability (#400)

    Fixed

    • Uint::mul_redc is now alloc free (#402)
    Open source →
  13. 1.12.3 03 Jun 2024
    Release notes

    Changed

    • Use borrowing/carrying ops in add/sub, remove bound checks in shifts (#366)
    • Make mul_mod non-allocating (#373)

    Fixed

    • Add alloc requirement to num-traits feature #363
    Open source →
  14. 1.12.1 12 Mar 2024
    Release notes

    Fixed

    • docs.rs build (#356)
    • uint! in item position (#360)
    Open source →
  15. 1.12.0 27 Feb 2024
    Release notes

    Added

    • Wrap the uint! macro to allow usage without needing uint import (#350)

    Fixed

    • Overflow check in overflowing_shr implementation (#347)
    Open source →
  16. 1.11.1 20 Nov 2023
    Release notes

    Fixed

    • Typo in Shr implementation (#343)

    Added

    Open source →
  17. 1.11.0 31 Oct 2023
    Release notes

    Added

    • bytemuck feature (#292)
    • Uint::is_zero() -> bool (#296)
    • num-traits features (#298)
    • U768 alias (#310)
    • Improved add and sub performance (#316)
    • Made add and sub functions const (#324)
    • Made {from,to}_{b,l}e_bytes const (#329)

    Fixed

    • Restricted RLP decoding to match the RLP spec and disallow leading zeros (#335)
    • leading_ones failed for non-aligned sizes.
    Open source →
  18. 1.10.1 30 Jul 2023
    Release notes

    Fixed

    • Fixed some support features (#289)
    Open source →
  19. 1.10.0 30 Jul 2023
    Release notes

    Added

    • Support for no_std environments (#274)
    • alloc feature (#277)
    Open source →
  20. 1.9.0 25 Jul 2023
    Release notes

    Added

    • Introduce ark-ff-04 feature flag for conversion to [email protected] types
    • Support for alloy-rlp
    • MSRV (Minimum Supported Rust Version) is now set at 1.65.0, from previously undefined
    • Implement TryFrom<bool> for Uint
    • New method: byte

    Changed

    • Make serde::Deserialize impl more permissive
    • Use Ethereum Quantity encoding for serde serialization when human-readable
    • Fix error in from_base_be that allowed instantiation of overflowing Uint
    • Updated fastrlp to 0.3, pyo3 to 0.19, and sqlx-core to 0.7
    • Improved fastrlp perfomance
    • Improved proptest performance
    • Made support module and its modules public
    • Made more algorithm functions public
    • Constified as_le_slice and as_le_bytes

    Removed

    • Automatic detection of nightly features. Enable them instead with the nightly cargo feature
    • Dependency on derive_more

    Fixed

    • from_base_le implementation by reversing the input iterator
    Open source →
  21. 1.8.0 19 Apr 2023
    Release notes

    Added

    • Support bn-rs, serde and uint! for Bits

    Fixed

    • Serde human readable now encodes the empty bitstring as 0x0 and rejects zero prefixes.
    Open source →
  22. 1.7.0 01 Nov 2022
    Release notes

    Added

    • Support rlp for Bits

    Fixed

    • Edge case in which an overflow occurs when parsing a Uint with uint! (#199).
    Open source →
  23. 1.6.0 29 Oct 2022
    Release notes

    Added

    • TryFrom<Uint> for usize
    • Bit type aliases (B128, B160, B256, B512, ...)
    • From and Into trait implementations for primitive-types bit types
    • Support for bn-rs
    • Derive Default for Bits

    Changed

    • (Breaking) Changed the arguments of pow and log to Uint.
    • More efficient wrapping_pow implementation.
    Open source →
  24. 1.5.1 25 Oct 2022
    Release notes

    Changed

    • Performance improvements in wrapping_mul and from_bytes_be.
    Open source →
  25. 1.5.0 24 Oct 2022
    Release notes

    Added

    • Add parity-scale-codec support.
    • Added unstable algorithms::div module and improved div algorithm.
    Open source →
  26. 1.4.1 15 Oct 2022
    Release notes

    Changed

    • Made primitive-types version flexible.
    Open source →
  27. 1.4.0 03 Oct 2022
    Release notes

    Added

    • Add Pyo3 support.
    • from now supports Uint arguments.
    • saturating_from, wrapping_from, to, wrapping_to, saturating_to.
    • wrapping_from_limbs_slice, overflowing_from_limbs_slice, saturating_from_limbs_slice.
    • Add zeroize and valuable support.

    Changed

    • ToUintError and FromUintError now contain wrapped value and other context.
    • from_uint and checked_from_uint are now deprecated.
    Open source →
  28. 1.3.0 09 Jun 2022
    Release notes

    Added

    • Added inv_mod, mul_redc, gcd, gcd_extended, lcm.
    • Added sqlx support.

    Changed

    • Renamed ring_inverse to inv_ring.
    Open source →
  29. 1.2.0 04 Jun 2022
    Release notes

    Added

    • Added reduce_mod, add_mod, mul_mod, pow_mod.
    • Added num-bigint and ark-ff support.
    • Made algorithms public, but with unstable API for now.

    Changed

    • Marked Uint::as_limbs_mut as unsafe.
    • Unified mul implementations and move to algorithms.

    Fixed

    • uint! macro incorrectly accepting hex digits in decimal.
    Open source →
  30. 1.1.0 31 May 2022
    Release notes

    Added

    • Added saturating_shl.
    • Added approx_log, approx_log2, approx_log10 for f64 log approximations.
    • Added approx_pow2 to construct from f64 log2 approximation.
    • Added root computing integer roots.

    Changed

    • Made logarithms usize to match BITS in pow, log functions.
    • Applied track_caller to div/rem ops to track div-by-zero easier.
    Open source →
  31. 1.0.0 28 May 2022
    Release notes

    Added

    • Added comparison.
    • Added add, sub, neg and sum functions.
    • Added mul functions.
    • Added division and remainder functions.
    • Added pow and log functions.
    • Added next_power_of_two and next_multiple_of functions.
    • Added checked_from_limb_slice and from_uint.

    Changed

    • from_limb_slice now handles arbitrary length slices.
    Open source →
  32. 0.3.0 23 May 2022
    Release notes

    Added

    • All the binary operations (not, and, or, xor, shifts, rotate, etc)
    • Bits, a newtype wrapped Uint restricted to non-numeric operations.
    • Postgres FromSql support and JSON column support.
    • from_base_le and from_base_be base conversion.
    • from_str_radix string base conversion up to base64.
    • FromStr trait with decimal, hex, octal and binary support.

    Changed

    • reverse_bits is now by value instead of &mut self.
    Open source →
  33. 0.2.1 18 May 2022
    Release notes

    Added

    • Extensive Postgres ToSql support supporting many column types.
    • TryFrom<Uint> for primitive integer types.
    • Added From conversions to f32 and f64.
    • Implement all rust formatting: Debug, Display, decimal, hex, etc.
    • >>= operator.
    • to_base_le and to_base_le base conversion spigots
    • reverse_bits, most_sigificant_bits bit methods.
    • Optimized as_le_{slice,bytes)_* accessors.

    Changed

    • Rewrote to_{be,le}_bytes_* to use optimized methods. This has trickle-down effects for a lot of conversions and formatting.
    Open source →
  34. 0.2.0 17 May 2022
    Release notes

    Added

    • Changelog
    • CI test on stable Rust.
    • Common bit-size aliases and nightly-only Uint<BITS> alias.
    • Added to_{be/le}_bytes_vec and made try_from_le_byte_iter public.
    • Added rlp and fastrlp support.
    • Added into_limbs, leading_zeros, bit_len, byte_len, checked_log2.
    • Added primitive-types support.

    Changed

    • Changed to Uint<BITS, LIMBS> to get stable compatibility!
    • Added generic BYTES parameter to to_{be/le}_bytes.
    • Renamed try_from_{be/le}_slice.
    Open source →
  35. 0.1.0 15 May 2022
    Release notes

    Added

    • Const-generic Uint structure.
    • Basic overflowing_add implementation.
    • Algorithms for division and gcd (currently unused).
    • uint! and const_for! macros.
    • Documentation with examples.
    • Support for rand, arbitrary, quickcheck, proptest, serde
    • Github actions for linting, testing, code coverage, cargo-audit.
    • Pushed to crates.io.

    <!-- links to version -->

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive