$rand = mcrypt_create_iv(5, MCRYPT_DEV_URANDOM);
$signature = substr(hash_hmac('sha256', $rand, $private_key, true), 0, 5);
$license = bin2hex($rand . $signature) . substr(bin2hex(mcrypt_create_iv(10, MCRYPT_DEV_URANDOM)), 0, 5);
return strtoupper(implode('-', str_split($license, 5)));