33 lines
475 B
PHP
33 lines
475 B
PHP
<?php
|
|
|
|
namespace api\core;
|
|
|
|
use \error\core\Error;
|
|
|
|
|
|
class authentification{
|
|
|
|
|
|
/* RENEW CYCLING HASH
|
|
*
|
|
* @hash<String> New hash
|
|
*
|
|
*/
|
|
public static function renew($args){
|
|
extract($args);
|
|
|
|
/* (1) Fetch cyclic-hashing-system -> check file */
|
|
$fn = __BUILD__.'/api/chs/hash';
|
|
|
|
if( !is_file($fn) )
|
|
return ['ModuleError'=>Error::UnreachableResource];
|
|
|
|
/* (2) Stores new hash */
|
|
file_put_contents($fn, $hash);
|
|
|
|
|
|
return [];
|
|
}
|
|
|
|
}
|