pub trait CairoFieldHelpers<F> {
    // Required methods
    fn lsb(&self) -> u8;
    fn u16_chunk(&self, pos: usize) -> F;
    fn to_u64(&self) -> u64;
    fn to_hex_be(&self) -> String;
}
Expand description

Field element helpers for Cairo

Required Methods§

source

fn lsb(&self) -> u8

Return field element as byte, if it fits. Otherwise returns least significant byte

source

fn u16_chunk(&self, pos: usize) -> F

Return pos-th 16-bit chunk as another field element

source

fn to_u64(&self) -> u64

Return first 64 bits of the field element

source

fn to_hex_be(&self) -> String

Return a field element in hexadecimal in big endian

Implementors§

source§

impl<F: Field> CairoFieldHelpers<F> for F