Skip to main content

is_valid

Function is_valid 

Source
pub fn is_valid(s: &str) -> bool
Expand description

Validate a hex string for dodecet encoding

Returns true if the string is valid for decoding.

ยงExample

use dodecet_encoder::hex;

assert!(hex::is_valid("123456"));
assert!(!hex::is_valid("12345")); // Not multiple of 3
assert!(!hex::is_valid("GHI")); // Non-hex characters