/// <summary> /// Generates a valid TOTP. /// </summary> /// <param name="accountSecretKey">User's secret key. Same as used to create the setup.</param> /// <returns>Creates a 6 digit one time password.</returns> public int Generate(string accountSecretKey) { return(TotpHasher.Hash(accountSecretKey, this.GetCurrentCounter())); }
private int Generate(string accountSecretKey, long counter, int digits = 6) { return(TotpHasher.Hash(accountSecretKey, counter, digits)); }
private int Generate(string accountSecretKey, int digits = 6) { return(TotpHasher.Hash(accountSecretKey, this.GetCurrentCounter(), digits)); }