Skip to main content

crypto_bigint/int/
encoding.rs

1//! Const-friendly decoding/encoding operations for [`Int`].
2
3use crate::{Int, Uint};
4
5impl<const LIMBS: usize> Int<LIMBS> {
6    /// Create a new [`Int`] from the provided big endian hex string.
7    ///
8    /// See [`Uint::from_be_hex`] for more details.
9    ///
10    /// # Panics
11    /// - if the hex is malformed or not zero-padded accordingly for the size.
12    #[must_use]
13    pub const fn from_be_hex(hex: &str) -> Self {
14        Self(Uint::from_be_hex(hex))
15    }
16}