-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,13 +92,11 @@ Now run the following and compare the output | |
<?php | ||
use OTPHP\TOTP; | ||
|
||
$totp = TOTP::createFromSecret( | ||
'JBSWY3DPEHPK3PXP', // New TOTP with custom secret | ||
10, // The period (int) | ||
'sha512', // The digest algorithm (string) | ||
8 // The number of digits (int) | ||
); | ||
$totp->setLabel('[email protected]'); // The label (string) | ||
$totp = TOTP::createFromSecret('JBSWY3DPEHPK3PXP'); // New TOTP with custom secret | ||
$totp->setPeriod(10); // The period (int) | ||
$totp->setDigest('sha512'); // The digest algorithm (string) | ||
$totp->setDigits(8); // The number of digits (int) | ||
$totp->setLabel('[email protected]'); // The label (string) | ||
|
||
echo 'Current OTP: ' . $totp->now(); | ||
``` |
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
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