mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-12 17:03:12 +00:00
Prepare to write conversation objects to database
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?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))
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user