mirror of
https://gitlab.com/omair-personal/izyim.git
synced 2026-08-19 12:24:11 +00:00
17 lines
302 B
PHP
17 lines
302 B
PHP
<?php
|
|
|
|
namespace App\Classes;
|
|
|
|
|
|
final class common
|
|
{
|
|
|
|
/**
|
|
* @param int $length
|
|
* @return string
|
|
* @throws \Exception
|
|
*/
|
|
public static function generateRandomHash(int $length = 10): string {
|
|
return substr(bin2hex(random_bytes(ceil($length / 2))), 0, $length);
|
|
}
|
|
} |