generate a hex code for an aircraft on creation #33

This commit is contained in:
Nabeel Shahzad
2018-02-12 20:58:23 -06:00
parent 2678514077
commit 5c58dfe1ae
5 changed files with 26 additions and 1 deletions

View File

@@ -9,4 +9,15 @@ namespace App\Support;
class ICAO
{
/**
* 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);
}
}