new pisilinux web sites
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php namespace ZN\Cryptography\Encode;
|
||||
/**
|
||||
* ZN PHP Web Framework
|
||||
*
|
||||
* "Simplicity is the ultimate sophistication." ~ Da Vinci
|
||||
*
|
||||
* @package ZN
|
||||
* @license MIT [http://opensource.org/licenses/MIT]
|
||||
* @author Ozan UYKUN [ozan@znframework.com]
|
||||
*/
|
||||
|
||||
use ZN\IS;
|
||||
|
||||
class GoldenAlgorithm extends EncodeExtends
|
||||
{
|
||||
/**
|
||||
* Generates encrypted data.
|
||||
*
|
||||
* @param string $data
|
||||
* @param string $additional = 'default'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function create(string $data, string $additional = 'default') : string
|
||||
{
|
||||
$algo = self::$config['type'];
|
||||
|
||||
if( ! IS::hash($algo) )
|
||||
{
|
||||
$algo = 'md5';
|
||||
}
|
||||
|
||||
$additional = hash($algo, $additional);
|
||||
|
||||
$data = hash($algo, $data);
|
||||
|
||||
return hash($algo, $data . $additional);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user