pub fn decode(s: &str) -> Result<Vec<Dodecet>>Expand description
Decode a hex string to a vector of dodecets
§Errors
Returns DodecetError::InvalidHex if:
- String length is not a multiple of 3
- Contains non-hex characters
- Any value > 4095
§Example
use dodecet_encoder::hex;
let hex_str = "123456789";
let dodecets = hex::decode(hex_str).unwrap();
assert_eq!(dodecets.len(), 3);
assert_eq!(dodecets[0].value(), 0x123);