NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #1860 most downloaded on crates.io
Unsigned integer type with const-generic bit length
Latest stable
1.21.1
Last release 1 months ago
23 Oct 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 37 of 37 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
38 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
chore: Release ruint version 1.21.1
chore: Release ruint version 1.21.1
chore(deps): bump taiki-e/install-action from 2.87.11 to 2.87.15 in the ci-weekly group by @dependabot[bot] in https://github.com/alloy-rs/ruint/pull/
Full Changelog: https://github.com/alloy-rs/ruint/compare/v1.20.1...v1.21.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
mul_mod for operands with nonzero high limbs (#647)mul_mod for a 2^BITS - 1 modulus (#647)add_mod for operands less than twice the modulus (#650)div_rem, / and % for numerators less than the divisor or that fit in a limb, and for power of two divisors (#651)overflowing_mul and the operations built on it for sizes up to 384 bits (#653)widening_mul (#654)Less first in cmp, so callers that only check for Less skip the equality test (#657)wrapping_shl, wrapping_shr and arithmetic_shr for three to eight limbs with branchless limb selects (#658)<, <=, >, >= and inv_mod (#669)div_rem, / and % for one- and two-limb divisors and for single-limb quotients (#671)div_rem, / and % with the div instruction on x86-64, a shorter reciprocal and a direct path for numerators one limb longer than the divisor (#674)<< and >> by a Uint, overflowing_shl, overflowing_shr and the operations built on them for three to eight limbs (#675)pow and the operations built on it for single-limb power of two bases (#676)inv_mod, gcd and gcd_extended for sizes above 128 bits (#678)div_3x2_ref returns the correct quotient (#666)num-traits: ToPrimitive::to_f32/to_f64 and FromPrimitive::from_f32/from_f64 no longer return None for values outside the u64 range (#642)f32::from(&Uint) rounds once to 24 bits instead of through f64, so it is correctly rounded (#652)num-traits: Document that NumCast::from returns None for source values at or above 2^128 and point float callers to FromPrimitive (#664)ark-ff: Document that the 0.4, 0.5 and 0.6 From<BigInt> and From<Fp> impls for Uint panic when the value does not fit in BITS bits (#665)chore(deps): bump the ci-weekly group with 2 updates by @dependabot[bot] in https://github.com/alloy-rs/ruint/pull/621
Full Changelog: https://github.com/alloy-rs/ruint/compare/v1.20.0...v1.20.1
u64/i64 on 32-bit targets and u128/i128, without truncating oversized shift amounts (#634)fix(algorithms): close soundness and safety-contract gaps by @prestwich in https://github.com/alloy-rs/ruint/pull/612
Full Changelog: https://github.com/alloy-rs/ruint/compare/v1.19.0...v1.20.0
PartialEq and is_zero on riscv to avoid memcmp libcalls (#604)wasm32-wasip1 in CI to catch 32-bit pointer-width bugs (#609)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)overflowing_shl/overflowing_shr overflow-flag false negatives, which also corrected the dependent checked_*/strict_*/saturating_* shifts and byte() (#603)from_str_radix rejecting the lowercase digits g–z in radix 64 (#605)f64 in TryFrom<f64> and saturate Uint→f64 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)add, mul, and gcd algorithms (#611)addmul_nx1/submul_nx1 unsafe and close soundness / safety-contract gaps in the unstable algorithms module (#612)fix: resolve easy TODOs and doc issues by @DaniPopes in https://github.com/alloy-rs/ruint/pull/571
to_be_bytes on big-endian platforms by @kayabaNerve in https://github.com/alloy-rs/ruint/pull/576Full Changelog: https://github.com/alloy-rs/ruint/compare/v1.18.0...v1.19.0
strict_* arithmetic operations (#595)ark-ff-06 feature flag for conversion to ark-ff@0.6 types (#584)from_str_radix const (#591)const (#590)Ord::cmp by comparing via subtraction (#579)to_be_bytes on big-endian platforms (#576)Use rkyv::ArchivedU64 by @DenisGorbachev in https://github.com/recmo/uint/pull/556
Full Changelog: https://github.com/recmo/uint/compare/v1.17.2...v1.18.0
from_str_radix (#557)Ord::cmp, const_eq, const_is_zero for small sizes (#561)to_be_bytes for full-limb sizes via per-limb swap_bytes (#569)rkyv::primitive::ArchivedU64 (#556)fix(docsrs): remove doc_auto_cfg by @DaniPopes in https://github.com/recmo/uint/pull/554
Full Changelog: https://github.com/recmo/uint/compare/v1.17.1...v1.17.2
Fix codspeed benches & add most_significant_bits bench by @Evalir in https://github.com/recmo/uint/pull/544
Full Changelog: https://github.com/recmo/uint/compare/v1.17.0...v1.17.1
unsafe to many unstable API functions in algorithms module, and
documented their conditions of use (COU). (#552)chore: add parse benches by @DaniPopes in https://github.com/recmo/uint/pull/518
serde_core instead of serde by @DaniPopes in https://github.com/recmo/uint/pull/527*next* functions const by @DaniPopes in https://github.com/recmo/uint/pull/533Full Changelog: https://github.com/recmo/uint/compare/v1.16.0...v1.17.0
ark-ff-05 feature flag for conversion to ark-ff@0.5 types (#526)*next_power_of_two and *next_multiple_of const (#533)TryFrom<f64> for Uint to speed it up, fixing edge cases and removing std requirements (#524)From<Uint> for f64 and f32 to speed it up, fixing edge cases and removing std requirements ([#535])Add Codspeed workflow by @recmo in https://github.com/recmo/uint/pull/468
bigdecimal crate by @klkvr in https://github.com/recmo/uint/pull/486mod algorithms by @DaniPopes in https://github.com/recmo/uint/pull/511Full Changelog: https://github.com/recmo/uint/compare/v1.15.0...v1.16.0
bigdecimal support (#486)PartialEq and PartialOrd implementations for primitive integers; minor breaking change for type inference (#491)to_base_be and core::fmt trait implementations are available without the "alloc" feature (#488)dep: update pyo3 to 0.25 by @Evalir in https://github.com/recmo/uint/pull/460
Full Changelog: https://github.com/recmo/uint/compare/v1.14.0...v1.15.0
chore: clippy by @DaniPopes in https://github.com/recmo/uint/pull/437
checked_byte bounds check and make it const by @DaniPopes in https://github.com/recmo/uint/pull/438try_from_{b,l}e_slice docs by @DaniPopes in https://github.com/recmo/uint/pull/439const ONE by @DaniPopes in https://github.com/recmo/uint/pull/448random, random_with, randomize, randomize_with methods by @DaniPopes in https://github.com/recmo/uint/pull/444Full Changelog: https://github.com/recmo/uint/compare/v1.13.1...v1.14.0
not function (#442)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)const ONE (#448)try_from_{b,l}e_slice documentation (#439)checked_byte bounds check and make it const (#438)fix: no_std build by removing unused dependency by @DaniPopes in https://github.com/recmo/uint/pull/433
Full Changelog: https://github.com/recmo/uint/compare/v1.13.0...v1.13.1
chore(deps): bump EmbarkStudios/cargo-deny-action from 1 to 2 by @dependabot in https://github.com/recmo/uint/pull/392
copy_*e_to_slice family by @Evalir in https://github.com/recmo/uint/pull/424as_le_bytes in big endian world by @pcw109550 in https://github.com/recmo/uint/pull/431Full Changelog: https://github.com/recmo/uint/compare/v1.12.4...v1.13.0
copy_le_to_slice family to allow easier writing to pre-allocated buffers (#424)Uint::checked_byte(idx: usize) -> Option<u8> (#429)feat: support for diesel @ 2.2 by @sinasab in https://github.com/recmo/uint/pull/404
Full Changelog: https://github.com/recmo/uint/compare/v1.12.3...v1.12.4
Uint::square_redc. (#402)subtle and der (#399)Uint::mul_redc is now alloc free (#402)belated repo release for already-released package version
belated repo release for already-released package version
mul_mod by @DaniPopes in https://github.com/recmo/uint/pull/373Full Changelog: https://github.com/recmo/uint/compare/v1.12.1...v1.12.3
mul_mod non-allocating (#373)alloc requirement to num-traits feature #363docs: fix docs.rs build by @DaniPopes in https://github.com/recmo/uint/pull/356
uint! in item position by @DaniPopes in https://github.com/recmo/uint/pull/360Full Changelog: https://github.com/recmo/uint/compare/v1.12.0...v1.12.1
chore: remove unused imports by @DaniPopes in https://github.com/recmo/uint/pull/350
uint! macro to allow usage without needing uint import by @DaniPopes in https://github.com/recmo/uint/pull/351overflowing_shr to fix overflow check by @tcoratger in https://github.com/recmo/uint/pull/347Full Changelog: https://github.com/recmo/uint/compare/v1.11.1...v1.12.0
uint! macro to allow usage without needing uint import (#350)overflowing_shr implementation (#347)fix: Shr impl by @DaniPopes in https://github.com/recmo/uint/pull/343
Full Changelog: https://github.com/recmo/uint/compare/v1.11.0...v1.11.1
Feat: Implement Pod trait on Uint types by @0xKitsune in https://github.com/recmo/uint/pull/292
Pod trait on Uint types by @0xKitsune in https://github.com/recmo/uint/pull/292array::IntoIter by @DaniPopes in https://github.com/recmo/uint/pull/316#[allow(clippy::inline_always)] by @DaniPopes in https://github.com/recmo/uint/pull/321missing_docs and clippy::missing_inline_in_public_items by @DaniPopes in https://github.com/recmo/uint/pull/322{from,to}_{b,l}e_bytes const by @DaniPopes in https://github.com/recmo/uint/pull/329from_*_bytes impl by @DaniPopes in https://github.com/recmo/uint/pull/332Full Changelog: https://github.com/recmo/uint/compare/v1.10.1...v1.11.0
bytemuck feature (#292)Uint::is_zero() -> bool (#296)num-traits features (#298)U768 alias (#310)add and sub performance (#316)add and sub functions const (#324){from,to}_{b,l}e_bytes const (#329)leading_ones failed for non-aligned sizes.Fixed some support features ([#289])
Support for no_std environments ([#274])
Fix some typos by @striezel in https://github.com/recmo/uint/pull/235
from_base_be overflow by @DaniPopes in https://github.com/recmo/uint/pull/253from_base_le by @DaniPopes in https://github.com/recmo/uint/pull/255Uint::byte by @DaniPopes in https://github.com/recmo/uint/pull/270Full Changelog: https://github.com/recmo/uint/compare/v1.8.0...v1.9.0
ark-ff-04 feature flag for conversion to ark-ff@0.4 typesalloy-rlpTryFrom<bool> for Uintbyteserde::Deserialize impl more permissiveQuantity encoding for serde serialization when human-readablefrom_base_be that allowed instantiation of overflowing Uintfastrlp to 0.3, pyo3 to 0.19, and sqlx-core to 0.7fastrlp perfomanceproptest performancesupport module and its modules publicalgorithm functions publicas_le_slice and as_le_bytesnightly cargo featurederive_morefrom_base_le implementation by reversing the input iteratorSupport bn-rs, serde and uint! for Bits
bn-rs, serde and uint! for Bits0x0 and rejects zero prefixes.Edge case in which an overflow occurs when parsing a Uint with uint! ([#199]).
rlp for BitsUint with uint! (#199).Bit type aliases (B128, B160, B256, B512, ...)
TryFrom<Uint> for usizeB128, B160, B256, B512, ...)From and Into trait implementations for primitive-types bit typesbn-rsDefault for Bitspow and log to Uint.wrapping_pow implementation.Performance improvements in wrapping_mul and from_bytes_be.
wrapping_mul and from_bytes_be.Add parity-scale-codec support.
parity-scale-codec support.algorithms::div module and improved div algorithm.Made primitive-types version flexible.
primitive-types version flexible.from_uint and checked_from_uint are now deprecated.
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.zeroize and valuable support.ToUintError and FromUintError now contain wrapped value and other context.from_uint and checked_from_uint are now deprecated.Added inv_mod, mul_redc, gcd, gcd_extended, lcm.
inv_mod, mul_redc, gcd, gcd_extended, lcm.sqlx support.ring_inverse to inv_ring.Added reduce_mod, add_mod, mul_mod, pow_mod.
reduce_mod, add_mod, mul_mod, pow_mod.num-bigint and ark-ff support.algorithms public, but with unstable API for now.Uint::as_limbs_mut as unsafe.mul implementations and move to algorithms.uint! macro incorrectly accepting hex digits in decimal.Added approx_log, approx_log2, approx_log10 for f64 log approximations.
saturating_shl.approx_log, approx_log2, approx_log10 for f64 log approximations.approx_pow2 to construct from f64 log2 approximation.root computing integer roots.usize to match BITS in pow, log functions.track_caller to div/rem ops to track div-by-zero easier.Added add, sub, neg and sum functions.
next_power_of_two and next_multiple_of functions.checked_from_limb_slice and from_uint.from_limb_slice now handles arbitrary length slices.All the binary operations (not, and, or, xor, shifts, rotate, etc)
Bits, a newtype wrapped Uint restricted to non-numeric operations.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.reverse_bits is now by value instead of &mut self.Extensive Postgres ToSql support supporting many column types.
TryFrom<Uint> for primitive integer types.From conversions to f32 and f64.Debug, Display, decimal, hex, etc.>>= operator.to_base_le and to_base_le base conversion spigotsreverse_bits, most_sigificant_bits bit methods.as_le_{slice,bytes)_* accessors.to_{be,le}_bytes_* to use optimized methods. This has trickle-down
effects for a lot of conversions and formatting.Common bit-size aliases and nightly-only Uint alias.
Uint<BITS> alias.to_{be/le}_bytes_vec and made try_from_le_byte_iter public.rlp and fastrlp support.into_limbs, leading_zeros, bit_len, byte_len, checked_log2.primitive-types support.Uint<BITS, LIMBS> to get stable compatibility!BYTES parameter to to_{be/le}_bytes.try_from_{be/le}_slice.Basic overflowing_add implementation.
Uint structure.overflowing_add implementation.uint! and const_for! macros.<!-- links to version -->
One column per quarter.