Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
util.php
1<?php
2
3namespace Bitrix\Im\Call;
4
5class Util
6{
10 public static function getUsers(array $idList)
11 {
12 $result = [];
13 foreach ($idList as $userId)
14 {
15 $result[$userId] = \Bitrix\Im\User::getInstance($userId)->getArray(['JSON' => 'Y', 'HR_PHOTO' => true]);
16 }
17
18 return $result;
19 }
20
21 public static function generateUUID()
22 {
23 if (function_exists('random_bytes'))
24 {
25 $data = random_bytes(16);
26 }
27 elseif (function_exists('openssl_random_pseudo_bytes'))
28 {
29 $data = openssl_random_pseudo_bytes(16);
30 } else
31 {
32 $data = uniqid('', true);
33 }
34
35 // set version to 4
36 $data[6] = chr(ord($data[6]) & 0x0f | 0x40);
37
38 // set bits 6-7 to 10
39 $data[8] = chr(ord($data[8]) & 0x3f | 0x80);
40
41 return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
42 }
43}
static getUsers(array $idList)
Definition util.php:10
static generateUUID()
Definition util.php:21