Platforms to show: All Mac Windows Linux Cross-Platform

CalculateTOTPMBS(Key as String, timeNow as UInt64, timeStart as UInt64, timeStep as UInt64, digitCount as Integer, DecodeBase32 as Boolean = false) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method Encryption and Hash MBS Util Plugin 22.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates a Time-based one-time password.

Key is the secret to use.
timeNow the current time in seconds, e.g. pass CurrentUnixTimeMBS.
timeStart the start time in seconds, e.g. zero.
timeStep the duration the code is valid in seconds, e.g. 30 seconds.
digitCount: the number of digits to generate, e.g. 6.

Uses SHA-1 as hash algorithm.
Added DecodeBase32 parameter in v22.5 to specify whether the password is base32 encoded and should be decoded.

The result is returned as number and may miss leading zeros, if you just convert it to text.

Some examples using this global method:

Blog Entries

The items on this page are in the following plugins: MBS Util Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...