[−][src]Trait xaynet::crypto::ByteObject
An interface for slicing into cryptographic byte objects.
Associated Constants
Loading content...Required methods
fn zeroed() -> Self
Creates a new object with all the bytes initialized to 0
.
fn as_slice(&self) -> &[u8]
Gets the object byte representation.
fn from_slice(bytes: &[u8]) -> Option<Self>
Creates an object from the given buffer.
Errors
Returns None
if the length of the byte-slice isn't equal to the length of the object.
Provided methods
fn from_slice_unchecked(bytes: &[u8]) -> Self
Creates an object from the given buffer.
Panics
Panics if the length of the byte-slice isn't equal to the length of the object.
fn generate() -> Self
Generates an object with random bytes