add some shtuff
This commit is contained in:
parent
1eb50fab4f
commit
9f5a4d837e
1 changed files with 9 additions and 1 deletions
10
uuid.php
10
uuid.php
|
@ -7,10 +7,18 @@ function randomLongHex() {
|
||||||
return bin2hex($byt);
|
return bin2hex($byt);
|
||||||
}
|
}
|
||||||
|
|
||||||
function uuid4() {
|
function genUuid4() {
|
||||||
$template = randomLongHex();
|
$template = randomLongHex();
|
||||||
$buildup = substr($template, 0, 8) . "-" . substr($template, 8, 4) . "-4" . substr($template, 13, 3) . "-1" . substr($template, 17, 3) . "-" . substr($template, 20, 12);
|
$buildup = substr($template, 0, 8) . "-" . substr($template, 8, 4) . "-4" . substr($template, 13, 3) . "-1" . substr($template, 17, 3) . "-" . substr($template, 20, 12);
|
||||||
|
|
||||||
return $buildup;
|
return $buildup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nilUuid() {
|
||||||
|
return "00000000-0000-0000-0000-000000000000";
|
||||||
|
}
|
||||||
|
|
||||||
|
function omniUuid() {
|
||||||
|
return "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue