网上只有 "123" 转成 123的例子, 可是我需要 "B8" 转 184 的功能呀, 只能自己撸一个
fn parse_hex_str(str: &String) -> u64 {
let mut rst: u64 = 0;
let len = str.len();
str.to_ascii_uppercase().bytes().enumerate().for_each(|(i, c)| {
let a = 'A' as u8;
let zero = '0' as u8;
let m = if c >= a {
c - a + 10
} else {
c - zero
};
rst += ((m as u64) << (len - i - 1) as u64 * 4);
});
rst
}