Skip to content

Commit

Permalink
Simplify readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorm committed Jun 2, 2024
1 parent b2057d8 commit 1018774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let token = totp.generate();
let delta = totp.validate({ token, window: 1 });

// Get the remaining seconds until the current token changes.
let seconds = (totp.period * (1 - ((Date.now() / 1000 / totp.period) % 1))) | 0;
let seconds = totp.period - (Math.floor(Date.now() / 1000) % totp.period);

// Convert to Google Authenticator key URI format (usually the URI is encoded
// in a QR code that can be scanned by the user. This functionality is outside
Expand Down

0 comments on commit 1018774

Please sign in to comment.