1. Go to this page and download the library: Download elephant-php/otp library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elephant-php / otp example snippets
use Elephant\Otp\OtpCode;
$code = new OtpCode()->generate();
use Elephant\Otp\OtpCode;
$code = new OtpCode()->generate(12);
use Elephant\Otp\Alphabet;
use Elephant\Otp\OtpCode;
$otp = new OtpCode();
$numeric = $otp->generate(alphabet: Alphabet::Numeric); // 483920
$hex = $otp->generate(16, Alphabet::Hex); // 9f03a8c12b4e70df
$readable = $otp->generate(10, Alphabet::Readable); // 7h4qz9x2wa
use Elephant\Otp\OtpCode;
new OtpCode()->generate(0); // throws InvalidArgumentException
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.