45 lines
1.1 KiB
PHP
Executable File
45 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
/* [0] On definit la racine __ROOT__ si c'est pas deja fait
|
|
=========================================================*/
|
|
if( !defined('__ROOT__') ) define('__ROOT__', dirname(__FILE__) );
|
|
if( !defined('__CONFIG__') ) define('__CONFIG__', __ROOT__.'/config' );
|
|
if( !defined('__BUILD__') ) define('__BUILD__', __ROOT__.'/build' );
|
|
if( !defined('__PUBLIC__') ) define('__PUBLIC__', __ROOT__.'/public_html' );
|
|
|
|
|
|
/* ACTIVE LE DEBUGGAGE (WARNING + EXCEPTION)
|
|
*
|
|
*/
|
|
function debug(){
|
|
ini_set('display_errors',1);
|
|
ini_set('display_startup_errors',1);
|
|
error_reporting(-1);
|
|
}
|
|
|
|
|
|
/*************************/
|
|
/* SECURE SHA1 ALGORITHM */
|
|
/*************************/
|
|
function secure_hash($data, $salt='">\[..|{@#))', $depth=1){
|
|
/* (1) On hash @depth fois
|
|
---------------------------------------------------------*/
|
|
$hash = $data;
|
|
$c = 0;
|
|
|
|
for( $h = 0 ; $h < $depth ; $h++ ){
|
|
$hash = hash('sha512', $salt.hash('sha512', $hash.'_)Q@#((%*_$%(@#') );
|
|
$c++;
|
|
}
|
|
|
|
|
|
/* (2) On renvoie le résultat
|
|
---------------------------------------------------------*/
|
|
return $hash;
|
|
}
|
|
|
|
|
|
\session_start();
|
|
|
|
?>
|