[][src]Struct num256::uint256::Uint256

pub struct Uint256(pub BigUint);

Methods

impl Uint256
[src]

Converts value to a signed 256 bit integer

Methods from Deref<Target = BigUint>

Returns the byte representation of the BigUint in big-endian byte order.

Examples

use num_bigint::BigUint;

let i = BigUint::parse_bytes(b"1125", 10).unwrap();
assert_eq!(i.to_bytes_be(), vec![4, 101]);

Returns the byte representation of the BigUint in little-endian byte order.

Examples

use num_bigint::BigUint;

let i = BigUint::parse_bytes(b"1125", 10).unwrap();
assert_eq!(i.to_bytes_le(), vec![101, 4]);

Returns the integer formatted as a string in the given radix. radix must be in the range 2...36.

Examples

use num_bigint::BigUint;

let i = BigUint::parse_bytes(b"ff", 16).unwrap();
assert_eq!(i.to_str_radix(16), "ff");

Returns the integer in the requested base in big-endian digit order. The output is not given in a human readable alphabet but as a zero based u8 number. radix must be in the range 2...256.

Examples

use num_bigint::BigUint;

assert_eq!(BigUint::from(0xFFFFu64).to_radix_be(159),
           vec![2, 94, 27]);
// 0xFFFF = 65535 = 2*(159^2) + 94*159 + 27

Returns the integer in the requested base in little-endian digit order. The output is not given in a human readable alphabet but as a zero based u8 number. radix must be in the range 2...256.

Examples

use num_bigint::BigUint;

assert_eq!(BigUint::from(0xFFFFu64).to_radix_le(159),
           vec![27, 94, 2]);
// 0xFFFF = 65535 = 27 + 94*159 + 2*(159^2)

Determines the fewest bits necessary to express the BigUint.

Returns (self ^ exponent) % modulus.

Panics if the modulus is zero.

Returns the truncated principal square root of self -- see Roots::sqrt

Returns the truncated principal cube root of self -- see Roots::cbrt.

Returns the truncated principal nth root of self -- see Roots::nth_root.

Trait Implementations

impl Clone for Uint256
[src]

Performs copy-assignment from source. Read more

impl From<[u8; 32]> for Uint256
[src]

impl<'a> From<&'a [u8]> for Uint256
[src]

impl From<u8> for Uint256
[src]

impl From<u16> for Uint256
[src]

impl From<u32> for Uint256
[src]

impl From<u64> for Uint256
[src]

impl From<u128> for Uint256
[src]

impl From<usize> for Uint256
[src]

impl Into<[u8; 32]> for Uint256
[src]

impl Eq for Uint256
[src]

impl PartialOrd<Uint256> for Uint256
[src]

impl Default for Uint256
[src]

impl PartialEq<Uint256> for Uint256
[src]

impl Ord for Uint256
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Debug for Uint256
[src]

impl Display for Uint256
[src]

impl Add<Uint256> for Uint256
[src]

The resulting type after applying the + operator.

impl Sub<Uint256> for Uint256
[src]

The resulting type after applying the - operator.

impl Mul<Uint256> for Uint256
[src]

The resulting type after applying the * operator.

impl Div<Uint256> for Uint256
[src]

The resulting type after applying the / operator.

impl AddAssign<Uint256> for Uint256
[src]

impl SubAssign<Uint256> for Uint256
[src]

impl MulAssign<Uint256> for Uint256
[src]

impl DivAssign<Uint256> for Uint256
[src]

impl Deref for Uint256
[src]

The resulting type after dereferencing.

impl Hash for Uint256
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl FromStr for Uint256
[src]

The associated error which can be returned from parsing.

impl LowerHex for Uint256
[src]

impl UpperHex for Uint256
[src]

impl CheckedMul for Uint256
[src]

impl ToPrimitive for Uint256
[src]

impl Bounded for Uint256
[src]

impl CheckedDiv for Uint256
[src]

impl CheckedSub for Uint256
[src]

impl CheckedAdd for Uint256
[src]

impl FromPrimitive for Uint256
[src]

impl Zero for Uint256
[src]

impl Serialize for Uint256
[src]

impl<'de> Deserialize<'de> for Uint256
[src]

Auto Trait Implementations

impl Send for Uint256

impl Sync for Uint256

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]