Skip to main content

string_to_fr

Function string_to_fr 

Source
pub fn string_to_fr(text: &str) -> Result<U256, CryptoError>
Expand description

Convert string to field element: left-pad to 32 bytes, interpret as Fr, then Poseidon hash.

Must match TypeScript stringToFr exactly for KDF domain separation.