summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/class/object.class.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php
index fe487bc..7a46e6e 100644
--- a/app/class/object.class.php
+++ b/app/class/object.class.php
@@ -192,6 +192,21 @@ abstract class Object extends Framework
return false;
}
+
+ /*
+ * Get a new, unique GUID for a new system object
+ */
+ function getNewGUID()
+ {
+ do
+ {
+ $sha = hash("sha256", random_bytes(64));
+ $guid = substr($sha, 0, 8);
+ }
+ while ($this->isGUID($guid));
+
+ return $guid;
+ }
}
?>