marcelkliemannel / kotlin-onetimepassword

A Kotlin one-time password library to generate "Google Authenticator", "Time-based One-time Password" (TOTP) and "HMAC-based One-time Password" (HOTP) codes based on RFC 4226 and 6238.
Apache License 2.0
154 stars 25 forks source link

Add helper method for time slot calculations #14

Closed bschramke closed 3 years ago

bschramke commented 3 years ago

Add a helper method to TimeBasedOneTimePasswordGenerator which calculates the start time of a given time slot (counter). This is really helpful for calculating how long a generated TOTP is still valid.

This is based on PR #13