Initial commit
This commit is contained in:
51
vendor/bedrock/functions/code.php
vendored
Normal file
51
vendor/bedrock/functions/code.php
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* functions/code.php
|
||||
*
|
||||
* This class is used for creation of custom codes used by the application.
|
||||
*
|
||||
* @todo Better code generation.
|
||||
*
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com/Core
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Bedrock\Functions;
|
||||
|
||||
use TheTempusProject\Canary\Canary as Debug;
|
||||
|
||||
class Code {
|
||||
/**
|
||||
* Generates a new confirmation code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function genConfirmation() {
|
||||
$code = md5( uniqid() );
|
||||
Debug::log( "Code Generated: Confirmation: $code" );
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a new install hash.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function genInstall() {
|
||||
$code = md5( uniqid() );
|
||||
Debug::log( "Code Generated: Token: $code" );
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a new token code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function genToken() {
|
||||
$code = md5( uniqid() );
|
||||
Debug::log( "Code Generated: Token: $code" );
|
||||
return $code;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user