kaspa-txscript 2.1.0

Kaspa txscript engine library
Documentation
1
2
3
4
5
6
7
8
/// Hex decode helper backed by `faster-hex`.
#[inline]
pub fn decode<T: AsRef<[u8]>>(data: T) -> Result<Vec<u8>, faster_hex::Error> {
    let input = data.as_ref();
    let mut bytes = vec![0u8; input.len() / 2];
    faster_hex::hex_decode(input, &mut bytes)?;
    Ok(bytes)
}