use crate::utils::crypt_utils::sha256_str;
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq)]
pub struct Nonce(uuid::Uuid);
impl Default for Nonce {
fn default() -> Self {
Self::new()
}
}
impl Nonce {
pub fn new() -> Self {
Self(uuid::Uuid::new_v4())
}
pub fn hash(&self) -> String {
sha256_str(self.0.as_bytes())
}
}