mirror of
https://github.com/Hizenberg469/BPIT-ATTENDANCE.git
synced 2026-04-20 02:02:25 +03:00
initial commit
This commit is contained in:
23
junet/html/encrypt_password.inc.php
Normal file
23
junet/html/encrypt_password.inc.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
function encrypt_password($password){
|
||||
$encrypt_psswd = '';
|
||||
$encrypt_idcs = '';
|
||||
$sz = strlen($password);
|
||||
$idx;
|
||||
|
||||
$set = new \Ds\Set();
|
||||
for( $i = 0 ; $i < $sz ; $i++ ){
|
||||
$idx = rand(0,$sz-1);
|
||||
while( $set->contains($idx) ){
|
||||
$idx = rand(0,$sz-1);
|
||||
}
|
||||
$encrypt_psswd .= $password[$idx];
|
||||
$set->add($idx);
|
||||
$encrypt_idcs .= chr($idx+33);
|
||||
}
|
||||
|
||||
$encrypt_psswd .= $encrypt_idcs;
|
||||
|
||||
return $encrypt_psswd;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user