Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
uuid.php
1<?php
2
4
5final class Uuid
6{
7 public static function getV4(): string
8 {
9 return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
10 random_int(0, 0xffff),
11 random_int(0, 0xffff),
12 random_int(0, 0xffff),
13 random_int(0, 0x0fff) | 0x4000,
14 random_int(0, 0x3fff) | 0x8000,
15 random_int(0, 0xffff),
16 random_int(0, 0xffff),
17 random_int(0, 0xffff)
18 );
19 }
20}