Open
Description
It would be really helpful if the hex crate had a built-in function to check whether a hex string consists entirely of zeroes. This is a common need in areas like cryptography and blockchain, where it’s often important to confirm if a hexadecimal string represents “nothing” or is effectively all zeroes.
fn is_zeroes(hex_str: &str) -> bool {
...
}
/// USAGE
use hex::is_zeroes;
assert!(is_zeroes("0x000000"));
assert!(!is_zeroes("0x123456"));
Feel free to assign me if this is a W
Metadata
Assignees
Labels
No labels