Crate array_bytes

Crate array_bytes 

Source
Expand description

A collection of array/bytes/hex utilities.

Completely optimized for blockchain development. Especially the Substrate.

Enums§

Error
The main error of array-bytes.

Traits§

Hex
Convert the given type to hex.
TryFromHex
Try to convert the given hex to a specific type.

Functions§

bytes2hex
AsRef<[u8]> to String.
hex2array
Just like hex2bytes but to a fixed length array.
hex2array_unchecked
Just like hex2array but without the checking.
hex2bytes
AsRef<[u8]> to Vec<u8>.
hex2bytes_unchecked
Just like hex2bytes but without checking.
hex2slice
AsRef<[u8]> to &[u8].
hex2slice_unchecked
Just like hex2slice but without checking.
hex_bytes2hex_str
Convert hex bytes to hex string.
hex_bytes2hex_str_unchecked
Just like hex_bytes2hex_str but without the checking.
hex_into
Try to convert AsRef<[u8]> to T directly, where T: From<Vec<u8>>.
hex_into_unchecked
Just like hex_into but without the checking.
hex_n_into
Try to convert AsRef<[u8]> to T directly, where T: From<[u8; N]>.
hex_n_into_unchecked
Just like hex_n_into but without the checking.
prefix_with
Prefixes the given element to the given array/slice/vector to make it a fixed-size array of length N.
slice2array
&[T] to [T; N].
slice2array_ref
&[T] to &[T; N].
slice2array_ref_unchecked
Just like slice2array_ref but without the checking.
slice2array_unchecked
Just like slice2array but without the checking.
slice_n_into
Convert &[T] to a type directly.
slice_n_into_unchecked
Just like slice_n_into but without the checking.
suffix_with
Suffixes the given element to the given array/slice/vector to make it a fixed-size array of length N.
vec2array
Vec<T> to [T; N].
vec2array_unchecked
Just like vec2array but without the checking.
vec_n_into
Convert Vec<T> to a type directly.
vec_n_into_unchecked
Just like vec_n_into but without the checking.

Type Aliases§

Result
The main result of array-bytes.