Function vec_to_hex_string

Source
pub fn vec_to_hex_string(bytes: Vec<u8>) -> String
Expand description

Convert a Vec to a string of hex bytes separated by spaces, with revelent bytes in green.

§Arguments

  • bytes - The Vec to convert

§Returns

Returns a String with the colored hex bytes separated by spaces

§Example

use evm_rs_emulator::debug::vec_to_hex_string;

let bytes = [255u8; 10].to_vec();
let hex_string = vec_to_hex_string(bytes);

assert_eq!(hex_string, "ff ff ff ff ff ff ff ff ff ff");