object_rainbow/hash/
hex.rs1use hex::FromHex;
2
3use crate::HASH_SIZE;
4
5use super::Hash;
6
7impl FromHex for Hash {
8 type Error = <[u8; HASH_SIZE] as FromHex>::Error;
9
10 fn from_hex<T: AsRef<[u8]>>(hex: T) -> Result<Self, Self::Error> {
11 Ok(Self(<[u8; HASH_SIZE]>::from_hex(hex)?))
12 }
13}