This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Gist to calculate Time-based One Time Password (TOTP). | |
This function is designed to be used in two modes: | |
- Current Mode | |
No timestamp supplied, and the current timestamp is considered. | |
This mode gives the totp at the present moment in time. | |
- Historic Mode | |
Here an explicit timestamp is supplied. This is to calculate a TOTP | |
that had occured at a moment in history. |