[][src]Function libotp::validate_hotp

pub fn validate_hotp(
    input: u32,
    validation_margin: i32,
    counter: u64,
    secret: &str,
    digits: u32
) -> Option<bool>

Validates HOTP inputs

Arguments

  • input - End user's input
  • validation_margin - The validation will check this amount of OTPs before and after the current one.
  • counter - End user's currnet OTP counter.
  • secret - base32 encoded shared-secret.
  • digits - OTP length in digits. At least 6 is recommended.

Notes

The program using this function should check that the provided input was not already used.