#include <stdint.h>
#include <time.h>
|
| char * | generate_totp_code (const char *base32_secret) |
| | Generates a 6-digit TOTP code from a base32-encoded secret for the current time.
|
| char * | generate_totp_code_at_time (const char *base32_secret, time_t current_time) |
| | Generates a 6-digit TOTP code from a base32-encoded secret for a specific time.
|
◆ generate_totp_code()
| char * generate_totp_code |
( |
const char * | base32_secret | ) |
|
Generates a 6-digit TOTP code from a base32-encoded secret for the current time.
- Parameters
-
| base32_secret | The base32-encoded TOTP secret. |
- Returns
- A dynamically allocated string containing the 6-digit TOTP code. The caller is responsible for freeing this string.
◆ generate_totp_code_at_time()
| char * generate_totp_code_at_time |
( |
const char * | base32_secret, |
|
|
time_t | current_time ) |
Generates a 6-digit TOTP code from a base32-encoded secret for a specific time.
- Parameters
-
| base32_secret | The base32-encoded TOTP secret. |
| current_time | The time to generate the TOTP code for. |
- Returns
- A dynamically allocated string containing the 6-digit TOTP code. The caller is responsible for freeing this string.