byt32 0.1.3

A CLI tool for converting 'str to hex' or 'hex to str'
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use aoko::no_std::{functions::ext::Utf8Ext, pipelines::pipe::Pipe};
use num::BigUint;

pub mod cli;

pub fn str_to_hex(s: &str) {
    println!("str to hex: 0x{:0<64x}", s.as_bytes().pipe(BigUint::from_bytes_be))
}

pub fn hex_to_str(h: &str) {
    println!("hex to str: {}", h.trim_start_matches("0x").pipe(hex::decode).unwrap().to_str().unwrap())
}