crypto_bigint::prelude

Trait ArrayEncoding

Source
pub trait ArrayEncoding: Encoding {
    type ByteSize: ArrayLength<u8> + Add + Eq + Ord + Unsigned;

    // Required methods
    fn from_be_byte_array(bytes: ByteArray<Self>) -> Self;
    fn from_le_byte_array(bytes: ByteArray<Self>) -> Self;
    fn to_be_byte_array(&self) -> ByteArray<Self>;
    fn to_le_byte_array(&self) -> ByteArray<Self>;
}
Expand description

Support for encoding a big integer as a GenericArray.

Required Associated Types§

Source

type ByteSize: ArrayLength<u8> + Add + Eq + Ord + Unsigned

Size of a byte array which encodes a big integer.

Required Methods§

Source

fn from_be_byte_array(bytes: ByteArray<Self>) -> Self

Deserialize from a big-endian byte array.

Source

fn from_le_byte_array(bytes: ByteArray<Self>) -> Self

Deserialize from a little-endian byte array.

Source

fn to_be_byte_array(&self) -> ByteArray<Self>

Serialize to a big-endian byte array.

Source

fn to_le_byte_array(&self) -> ByteArray<Self>

Serialize to a little-endian byte array.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ArrayEncoding for U64

Source§

impl ArrayEncoding for U128

Source§

impl ArrayEncoding for U192

Source§

impl ArrayEncoding for U256

Source§

impl ArrayEncoding for U384

Source§

impl ArrayEncoding for U448

Source§

impl ArrayEncoding for U512

Source§

impl ArrayEncoding for U576

Source§

impl ArrayEncoding for U768

Source§

impl ArrayEncoding for U832

Source§

impl ArrayEncoding for U896

Source§

impl ArrayEncoding for U1024

Source§

impl ArrayEncoding for U1536

Source§

impl ArrayEncoding for U1792

Source§

impl ArrayEncoding for U2048

Source§

impl ArrayEncoding for U3072

Source§

impl ArrayEncoding for U3584

Source§

impl ArrayEncoding for U4096

Source§

impl ArrayEncoding for U6144

Source§

impl ArrayEncoding for U8192