Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
asilvafx committed Dec 29, 2024
1 parent 7743795 commit b4ba0d7
Show file tree
Hide file tree
Showing 13 changed files with 1,814 additions and 45 deletions.
32 changes: 32 additions & 0 deletions app/core/functions/Crypt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

class Crypt
{

function generate($string)
{

$hash = password_hash(
$string,
PASSWORD_DEFAULT
);
return $hash;
}
function verify($string, $hash)
{

return password_verify($string, $hash);
}
function generateRandomString($length = 10)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';

for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[random_int(0, $charactersLength - 1)];
}

return $randomString;
}
}
Loading

0 comments on commit b4ba0d7

Please sign in to comment.