mirror of
https://github.com/friendica/friendica
synced 2025-04-27 21:50:11 +00:00
UUID instead of GUID
This commit is contained in:
parent
9ec30010c5
commit
60b0759b50
13 changed files with 40 additions and 47 deletions
|
@ -161,6 +161,18 @@ class System extends BaseObject
|
|||
killme();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a random string in the UUID format
|
||||
*
|
||||
* @param bool|string $prefix A given prefix (default is empty)
|
||||
* @return string a generated UUID
|
||||
*/
|
||||
public static function UUID($prefix = '')
|
||||
{
|
||||
$guid = System::createGUID(32, $prefix);
|
||||
return substr($guid, 0, 8). '-' . substr($guid, 8, 4) . '-' . substr($guid, 12, 4) . '-' . substr($guid, 16, 4) . '-' . substr($guid, 20, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a GUID with the given parameters
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue