pub fn digest(
secret: String,
counter: u128,
algorithm: Algorithm
) -> Result<Vec<u8>, GenerationError>
Expand description
Applys a specified keyed hashing function (hmac).
secret
- A string of the secret
counter
- The counter to hash
algorithm
- The preferred algorithm
use lugnut::{ digest, Algorithm };
let hash = digest("My secret".to_string(), 5000, Algorithm::Sha1);