pub(crate) struct RadixDivisionParams {
radix: u32,
digits_per_limb: usize,
bits_per_limb: u32,
recip_limb: Reciprocal,
digits_large: usize,
div_large: [Limb; 16],
recip_large: Reciprocal,
shift_large: u32,
}Expand description
Parameter set used to perform radix encoding by division.
Fields§
§radix: u32§digits_per_limb: usize§bits_per_limb: u32§recip_limb: Reciprocal§digits_large: usize§div_large: [Limb; 16]§recip_large: Reciprocal§shift_large: u32Implementations§
Source§impl RadixDivisionParams
impl RadixDivisionParams
const ALL: [Self; 31]
pub const fn for_radix(radix: u32) -> Self
Sourcepub const fn encoded_size(&self, limb_count: usize) -> usize
pub const fn encoded_size(&self, limb_count: usize) -> usize
Get the minimum size of the required output buffer for encoding a set of limbs.
Sourcepub fn encode_limbs(&self, limbs: &mut UintRef, out: &mut [u8])
pub fn encode_limbs(&self, limbs: &mut UintRef, out: &mut [u8])
Encode the mutable limb slice to the output buffer as ASCII characters in base
radix. Leading zeros are added to fill out. The slice limbs is used as a
working buffer. Output will be truncated if the provided buffer is too small.
fn encode_limbs_small(&self, limbs: &mut UintRef, out: &mut [u8])
Trait Implementations§
Source§impl Clone for RadixDivisionParams
impl Clone for RadixDivisionParams
Source§fn clone(&self) -> RadixDivisionParams
fn clone(&self) -> RadixDivisionParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RadixDivisionParams
impl Debug for RadixDivisionParams
impl Copy for RadixDivisionParams
Auto Trait Implementations§
impl Freeze for RadixDivisionParams
impl RefUnwindSafe for RadixDivisionParams
impl Send for RadixDivisionParams
impl Sync for RadixDivisionParams
impl Unpin for RadixDivisionParams
impl UnsafeUnpin for RadixDivisionParams
impl UnwindSafe for RadixDivisionParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more