mirror of
https://github.com/Hizenberg469/BPIT-ATTENDANCE.git
synced 2026-06-14 19:58:24 +03:00
initial commit
This commit is contained in:
@@ -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