mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 16:06:15 +00:00
26 lines
661 B
PHP
26 lines
661 B
PHP
<?php
|
|
/**
|
|
* Nextcloud - Phone Sync
|
|
*
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
* later. See the COPYING file.
|
|
*
|
|
* @author Loic Blot <loic.blot@unix-experience.fr>
|
|
* @copyright Loic Blot 2014-2018
|
|
*/
|
|
|
|
namespace lib;
|
|
|
|
|
|
class UUIDGenerator {
|
|
public static function generate() {
|
|
if (function_exists('com_create_guid') === true) {
|
|
return trim(com_create_guid(), '{}');
|
|
}
|
|
|
|
return strtolower(sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X',
|
|
mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151),
|
|
mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535))
|
|
);
|
|
}
|
|
} |