use ark_ff::{BigInteger, Field, PrimeField, Zero};
pub mod elligator2;
pub mod swu;
pub mod wb;
pub fn parity<F: Field>(element: &F) -> bool {
element
.to_base_prime_field_elements()
.find(|&x| !x.is_zero())
.map_or(false, |x| x.into_bigint().is_odd())
}