Function libotp::validate_totp[][src]

pub fn validate_totp(
    input: u32,
    validation_margin: u32,
    secret: &str,
    digits: u32,
    time_step: u64,
    time_start: u64
) -> Option<bool>

Validates a user provided TOTP.

Arguments

  • input - End user provided input
  • validation_margin - Checks this amount of OTP steps before and after the current OTP.
  • secret - A base32 encoded shared-secret.
  • digits - OTP length in digits. At least 6 is recommended.
  • time_step - Time frame for OTPs.
  • time_start - The beginning of time for this OTP (T0).