array-bytes
Collection of Array/Bytes/Hex Utilities.
Abilities
TryFromHex
Trait
- Convert
Hex
toNum
- type
&str -> isize
- type
&str -> i8
- type
&str -> i16
- type
&str -> i32
- type
&str -> i64
- type
&str -> i128
- type
&str -> usize
- type
&str -> u8
- type
&str -> u16
- type
&str -> u32
- type
&str -> u64
- type
&str -> u128
- type
bytes
Prefixed Functions
- Convert
Bytes
toHex
- type
&[u8] -> String
- type
hex
Prefixed Functions
- Build fixed length
Array
fromHex
- type
&str -> [u8; N]
- type
- Convert
Hex
toBytes
- type
&str -> Vec<u8>
- type
- Transform
Hex
toT
- type
&str -> T
- e.g.
"0x..." -> [u8; 20] -> H160
- type
slice
Prefixed Functions
- Build fixed length
Array
fromSlice
- type
&[T] -> [T; N]
- type
- Transform
Slice
toG
- type
&[T] -> G
- e.g.
&[0_u8, ...] -> [u8; 20] -> H160
- type
vec
Prefixed Functions
- Build fixed length
Array
fromVec
- type
Vec<T> -> [T; N]
- type
- Transform
Vec
toG
- type
Vec<T> -> G
- e.g.
vec![0_u8, ...] -> [u8; 20] -> H160
- type
Serde Support (require feature serde
)
#[serde(deserialize_with = "array_bytes::hex_deserialize_into")]
- type
S -> T
- e.g.
"0x..." -> H160
- type
#[serde(deserialize_with = "array_bytes::de_hex2num")]
- type
S -> Num
- e.g.
"0xA" -> 10_u32
- type
#[serde(deserialize_with = "array_bytes::de_hex2bytes")]
- type
S -> Vec<u8>
- e.g.
"0x00" -> vec![0_u8]
- type