phpvms/app/Support/ICAO.php

24 lines
441 B
PHP
Raw Normal View History

<?php
namespace App\Support;
/**
* ICAO Helper Tools
*/
class ICAO
{
/**
* Create a random hex code. Eventually this may follow the format in:
* ICAO Aeronautical Telecommunications, Annex 10, Vol. III, chapter 9
2018-08-27 00:40:04 +08:00
*
* @param null $country
2018-08-27 00:40:04 +08:00
*
* @return string
*/
public static function createHexCode($country = null)
{
$bytes = random_bytes(4);
return bin2hex($bytes);
}
}