e-CryptIt Engine Xojo Plugin |

# Einhugur_2FA_TOTP.GenerateValue Method

Generates 6 or 8 digit value from given secret key and current time and also returns how many seconds are remaining of the 30 second window. This variation generates value for customised implementation where you can choose algorithm, digits and time.

shared GenerateValue(
secretKey as String,
algorithm as Einhugur_2FA_TOTP.Algorithms,
digits as Einhugur_2FA_TOTP.Digits,
seconds as UInt16,
ByRef secondsRemaining as Integer) as String

#### Parameters

secretKey
  The secret key.
  Secret keys are represented in various of ways and the plugin will preprocess them correctly to take all representations.
  For example then all of the following keys are equal:
  N7P7TWR3Q5WUA2XG
  N7P7 TWR3 Q5WU A2XG
  n7P7 tWR3 q5WU a2XG
algorithm
  The algorithm to use. Standard implementation uses HMAC_SHA1.
digits
  Digits to use. Standard implementation uses six.
seconds
  Seconds for the time window. Standard implementation is 30 seconds.
secondsRemaining (ByRef parameter)
  ByRef parameter which returns how many seconds are remaining of the 30 second window.

#### Returns

String
  6 or 8 digit number.

#### Remarks

This function can throw InvalidArgumentException.
Some authentication apps only support the standard implementation while more advanced apps support customised setup.

#### See Also

Einhugur_2FA_TOTP Class