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