ayun-hash 0.23.0

The RUST Framework for Web Rustceans.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::Hash;
use argon2::{Argon2, Params};
use ayun_core::{errors::ContainerError, traits::InstanceTrait, Container, Result};

impl InstanceTrait for Hash {
    fn register(_: &Container) -> Result<Self, ContainerError>
    where
        Self: Sized,
    {
        let argon2 = Argon2::new(
            argon2::Algorithm::Argon2id,
            argon2::Version::V0x13,
            Params::default(),
        );

        Ok(Self::new(argon2))
    }
}