mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-23 22:30:41 +01:00
14 lines
180 B
PHP
14 lines
180 B
PHP
|
<?php
|
||
|
|
||
|
function hash_password($pass, $salt)
|
||
|
{
|
||
|
return hash("sha512", "$pass$salt");
|
||
|
}
|
||
|
|
||
|
function create_salt(int $length = 32)
|
||
|
{
|
||
|
return bin2hex(random_bytes($length));
|
||
|
}
|
||
|
|
||
|
?>
|