Initial Commit

This commit is contained in:
2024-02-08 12:07:49 -07:00
parent 5813b1109f
commit 43077b57ed
5471 changed files with 682195 additions and 0 deletions
@@ -0,0 +1,23 @@
<?php
namespace YooKassa\Helpers;
class UUID
{
/**
* @return string
* @throws \Exception
*/
public static function v4()
{
$hexData = bin2hex(Random::bytes(16));
$parts = str_split($hexData, 4);
$parts[3] = '4' . substr($parts[3], 1);
$parts[4] = '8' . substr($parts[4], 1);
return vsprintf('%s%s-%s-%s-%s-%s%s%s',
$parts
);
}
}