Expand description
Bytes Util Module
Functionsยง
- bytes32_
to_ hex_ string - Convert a
[u8; 32]to a bytes string. - deploy_
bootstrap - Builds the deployment bootstrap that copies the runtime code into memory and returns it
- format_
even_ bytes - Pad odd-length byte string with a leading 0
- format_
literal - Converts a literal into its bytecode string representation
- format_
push0 ๐ - Formats a
PUSH0opcode if supported by the EVM version, otherwise falls back toPUSH1 0x00 - hex_
to_ usize - Wrapper to convert a hex string to a usize.
- literal_
gen - Converts a value literal to its smallest equivalent
PUSHXbytecode. Leading zeros are removed. - pad_
n_ bytes - Pad a hex string with n 0 bytes to the left. Will not pad a hex string that has a length
greater than or equal to
num_bytes * 2 - push_
min_ ๐width - Hex-encodes
valueas the smallest PUSHn (n >= 1) that holds it - str_
to_ bytes32 - Convert a string slice to a
[u8; 32]Pads zeros to the left of significant bytes in the[u8; 32]slice. i.e. 0xa57b becomes[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, 123] - str_
to_ vec - Convert string slice to
Vec<u8>, size not capped