Skip to main content

decode_const

Function decode_const 

Source
pub const fn decode_const<const N: usize>(hex: &[u8]) -> [u8; N]
Expand description

A const fn to decode a hex string to a fixed-length array at compile time. Panics if the input was not a valid hex string.

To decode to a fixed-length array without panicking on invalid inputs, use the FromHex trait instead, e.g. <[u8; 32]>::from_hex(&s).