mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-16 05:33:00 +00:00
14 lines
239 B
PHP
14 lines
239 B
PHP
|
<?php
|
||
|
|
||
|
namespace SBRL;
|
||
|
|
||
|
class Generators {
|
||
|
|
||
|
public static function crypto_secure_id(int $length = 64) { // 64 = 32
|
||
|
$length = ($length < 4) ? 4 : $length;
|
||
|
return bin2hex(random_bytes(($length-($length%2))/2));
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|