INNER CODE UNIT · Rust
scalar_from_hex_string
renegade-fi/renegade · crates/circuits/circuit-types/src/lib.rs:182
pub fn scalar_from_hex_string<'de, D>(d: D) -> Result<Scalar, D::Error>
where
D: Deserializer<'de>,
{
Ok(biguint_to_scalar(&biguint_from_hex_string(d)?))
}
/// A helper to serialize a BigUint to a hex string
pub fn biguint_to_hex_string<S>(val: &BigUint, s: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
s.serialize_str(&format!("0x{}", val.to_str_radix(16 /* radix */)))
}
/// A helper to serialize a BigUint to a hex address
pub fn biguint_to_hex_addr<S>(val: &BigUint, s: S) -> Result<S::Ok, S::Error>
where