fn totp_generate_tolerance(
    hex_seed: &str,
    tolerance: i32,
    time_override: Option<i64>,
) -> Result<String> {
    let mut results: Vec<String> = Vec::new();
    for i in -tolerance..(tolerance + 1) {
        let result = totp_generate(hex_seed, i.try_into().unwrap(), time_override)?;
        results.push(result)
    }
    Ok(serde_json::to_string(&results)?)
}
/// Generates multiple TOTP codes from 20 character hex_seed, with time step +-tolerance
/// time_override is used as the current unix time instead of the current system time for testing
Generates multiple TOTP codes from 20 character hex_seed, with time step +-tolerance
time_override is used as the current unix time instead of the current system time for testing
Generates multiple TOTP codes from 20 character hex_seed with time step + - tolerance time_override is used as the current unix time instead of the current system time for testing
fn totp_generate_tolerance(
    hex_seed: &str,
    tolerance: i32,
    time_override: Option<i64>,
) -> Result<String> {
    let mut results: Vec<String> = Vec::new();
    for i in -tolerance..(tolerance + 1) {
        let result = totp_generate(hex_seed, i.try_into().unwrap(), time_override)?;
        results.push(result)
    }
    Ok(serde_json::to_string(&results)?)
}
fn totp_generate_tolerance ( hex_seed : & str , tolerance : i32 , time_override : Option < i64 > , ) -> Result < String > { let mut results : Vec < String > = Vec :: new ( ) ; for i in - tolerance .. ( tolerance + 1 ) { let result = totp_generate ( hex_seed , i . try_into ( ) . unwrap ( ) , time_override ) ? ; results . push ( result ) } Ok ( serde_json :: to_string ( & results ) ? ) }
Generates multiple TOTP codes from 20 character hex_seed, with time step +-tolerance
time_override is used as the current unix time instead of the current system time for testing
Generates multiple TOTP codes from 20 character hex_seed with time step + - tolerance time_override is used as the current unix time instead of the current system time for testing
hex_seed
&str
tolerance
i32
time_override
Option<i64>
hex_seed
&str
tolerance
i32
time_override
Option<i64>