icp-eth 0.2.3

ICP + Ethereum cross-chain utilities
Documentation
1
2
3
4
5
6
7
8
9
use hex::FromHexError;

pub fn to_hex(data: &[u8]) -> String {
    format!("0x{}", hex::encode(data))
}

pub fn from_hex(data: &str) -> Result<Vec<u8>, FromHexError> {
    hex::decode(&data[2..])
}