int oath_totp_generate(const char * secret, size_t secret_length, time_t now, unsigned time_step_size, time_t start_offset, unsigned digits, char * output_otp);
The system parameter time_step_size describes how long the time window for each OTP is. The recommended value is 30 seconds, and you can use the value 0 or the symbol OATH_TOTP_DEFAULT_TIME_STEP_SIZE to indicate this.
The system parameter start_offset denote the Unix time when time steps are started to be counted. The recommended value is 0, to fall back on the Unix epoch) and you can use the symbol OATH_TOTP_DEFAULT_START_TIME to indicate this.
The output_otp buffer must have room for at least digits characters, plus one for the terminating NUL.
Currently only values 6, 7 and 8 for digits are supported. This restriction may be lifted in future versions.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.