PHP code example of faj1 / otp
1. Go to this page and download the library: Download faj1/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/ */
faj1 / otp example snippets
public function testVerify()
{
var_dump(Otp::verify('KSWUWUM334TJFY5HRLQFFI6UTDDYWIXJP2YNQOJH6J4I2IKQ4OESH5HAMWDBL3VOC7LM55UBLUFWANFZR7ZSUQLH5VLHK3BM2DW2DGQ',696735));
$this->assertTrue(true, 'Code executed successfully without exceptions.');
}
public function testGetImg()
{
echo Otp::getImg('KSWUWUM334TJFY5HRLQFFI6UTDDYWIXJP2YNQOJH6J4I2IKQ4OESH5HAMWDBL3VOC7LM55UBLUFWANFZR7ZSUQLH5VLHK3BM2DW2DGQ').PHP_EOL;
$this->assertTrue(true, 'Code executed successfully without exceptions.');
}
public function testGetSecret()
{
echo Otp::getSecret().PHP_EOL;
$this->assertTrue(true, 'Code executed successfully without exceptions.');
}
public function testGetOpt()
{
echo Otp::getOpt('KSWUWUM334TJFY5HRLQFFI6UTDDYWIXJP2YNQOJH6J4I2IKQ4OESH5HAMWDBL3VOC7LM55UBLUFWANFZR7ZSUQLH5VLHK3BM2DW2DGQ').PHP_EOL;
$this->assertTrue(true, 'Code executed successfully without exceptions.');
}