Skip to main content

decode_hex

Function decode_hex 

Source
pub fn decode_hex(hex: &str) -> Result<Vec<u8>, ScriptError>
Expand description

Decode a hexadecimal string into a byte vector.

Accepts both uppercase and lowercase hex digits. Does not accept a 0x prefix — callers must strip it if present.

§Errors

Returns ScriptError::InvalidHex if the string has an odd number of characters or contains non-hex characters.