Trait crypto_bigint::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>;
}
Available on crate feature
generic-array
only.Expand description
Support for encoding a big integer as a GenericArray
.
Required Associated Types§
Required Methods§
sourcefn from_be_byte_array(bytes: ByteArray<Self>) -> Self
fn from_be_byte_array(bytes: ByteArray<Self>) -> Self
Deserialize from a big-endian byte array.
sourcefn from_le_byte_array(bytes: ByteArray<Self>) -> Self
fn from_le_byte_array(bytes: ByteArray<Self>) -> Self
Deserialize from a little-endian byte array.
sourcefn to_be_byte_array(&self) -> ByteArray<Self>
fn to_be_byte_array(&self) -> ByteArray<Self>
Serialize to a big-endian byte array.
sourcefn to_le_byte_array(&self) -> ByteArray<Self>
fn to_le_byte_array(&self) -> ByteArray<Self>
Serialize to a little-endian byte array.
Object Safety§
This trait is not object safe.