Function lugnut::digest[][src]

pub fn digest(
    secret: String,
    counter: u128,
    algorithm: Algorithm
) -> Result<Vec<u8>, GenerationError>
Expand description

Applys a specified keyed hashing function (hmac).

Arguments

  • secret - A string of the secret
  • counter - The counter to hash
  • algorithm - The preferred algorithm

Examples

use lugnut::{ digest, Algorithm };
let hash = digest("My secret".to_string(), 5000, Algorithm::Sha1);