Module bytes

Source

Functionsยง

_add
Add a u64 to a u256 expressed as a [u8; 32]
_hex_string_to_bytes
Convert a [u8; 32] to a u64
_pad_right
Pad a u8 with no particular length to 32 bytes to return a [u8; 32] It adds zeros to the right of the u8 instead of the left
bytes32_to_address
Convert a [u8; 32] to a [u8; 20]
pad_left
Pad a u8 with no particular length to 32 bytes to return a [u8; 32] It adds zero padding to the left
strip_zero_padding
Remove zero padding from a [u8; 32] to return only the relevant bytes
u64_to_u256_array
Convert a u64 to a [u8; 32]