Crates.io | hex-utilities |
lib.rs | hex-utilities |
version | 0.1.5 |
source | src |
created_at | 2022-08-24 21:53:31.504619 |
updated_at | 2022-09-27 14:54:22.70935 |
description | Utilities for working with hexadecimal numbers |
homepage | |
repository | |
max_upload_size | |
id | 651814 |
size | 8,951 |
A collection of utilities for working with hexadecimals
Add package to Cargo.toml file
[dependencies]
hex-utilities = "0.1.5"
use hex_utilities::{
get_text_for_hex,
}
// Convert hext to text
// Should work similiar to this http://www.unit-conversion.info/texttools/hexadecimal
let hex = "30784e6f6e63652077617320666f756e646564".to_string();
let expected_text = "0xNonce was founded".to_string();
let maybe_text = get_text_for_hex(&hex);
let text = match maybe_text {
Ok(text) => text.to_string(),
Err(_) => "wrong".to_string(),
};
assert_eq!(text, expected_text);
Available methods and documentation can be found here
MIT © Joe Gesualdo