uint
uint copied to clipboard
Rust Uint crate using const-generics
I'd like to be able to initialize a `U256` like this: ```rust foo(10.into()); ``` Where `foo` is a function that takes a `U256` as an input. This operation is not...
## Motivation The `Vec` allocation for intermediate result adds a lot of overhead to `mul_mod`. ## Solution Unfortunately no good solutions, but in the new variant the caller can provide...
*On 2023-09-30 @prestwich wrote in [`d705f65`](https://github.com/recmo/uint/commit/d705f654344a36e67fc30e8cdbf7ef707d268a0b) “Merge pull request #322 from DaniPopes/more-clippies”:* document algorithms ```rust //! ⚠️ Collection of bignum algorithms. //! //! **Warning.** Most functions in this module are...
This PR should fix breaking changes for upcoming parity-scale-codec versions ## Motivation We have added some constraints to the HasCompact trait in https://github.com/paritytech/parity-scale-codec/pull/512 to fix MaxEncodedLen for compact fields. ```diff...
*On 2023-08-28 @recmo wrote in [`585c5ce`](https://github.com/recmo/uint/commit/585c5ceb8cabe04c17ad4b8f4d835d3ea0328d60) “Merge pull request #298 from recmo/num-traits”:* Expose actual merged mul_add algo. ```rust impl MulAdd for Uint { type Output = Self; #[inline(always)] fn mul_add(self,...
*On 2023-08-28 @recmo wrote in [`585c5ce`](https://github.com/recmo/uint/commit/585c5ceb8cabe04c17ad4b8f4d835d3ea0328d60) “Merge pull request #298 from recmo/num-traits”:* AsPrimitive ```rust pow::Pow, sign::Unsigned, CheckedEuclid, Euclid, Inv, MulAdd, MulAddAssign, Num, NumCast, }; // TODO: AsPrimitive // Note. We...
*On 2023-08-28 @recmo wrote in [`585c5ce`](https://github.com/recmo/uint/commit/585c5ceb8cabe04c17ad4b8f4d835d3ea0328d60) “Merge pull request #298 from recmo/num-traits”:* Support for many more traits and crates. https://crates.io/crates/der https://crates.io/crates/bitvec ```rust mod serde; pub mod sqlx; mod valuable; mod...
**Version** 1.10.1 **Platform** Linux x1us 6.1.41-1-MANJARO #1 SMP PREEMPT_DYNAMIC Tue Jul 25 09:17:30 UTC 2023 x86_64 GNU/Linux **Description** It looks like when formating to hex string, U256::ZERO is handled differently:...
*On 2023-08-13 @prestwich wrote in [`55c5411`](https://github.com/recmo/uint/commit/55c5411476924097c5d471fbf7ceb3181951bf2c) “Merge pull request #293 from recmo/remco/base-to”:* Find an allocation free method. Maybe extract from the top? ```rust /// /// # Panics /// /// Panics...
*On 2023-08-13 @prestwich wrote in [`55c5411`](https://github.com/recmo/uint/commit/55c5411476924097c5d471fbf7ceb3181951bf2c) “Merge pull request #293 from recmo/remco/base-to”:* Internalize this trick so the user won't have to worry about it. Panics Panics if the base is...