summaryrefslogtreecommitdiffstats
path: root/app/class/object.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2015-12-18 13:52:19 -0500
committerMalf Furious <m@lfurio.us>2015-12-18 13:52:19 -0500
commit877eccf539bfd3a365d8658ed63d096a13e57b00 (patch)
treea118ccc722821dd8a81fd90c2030debd704553a5 /app/class/object.class.php
parent25947336340ac5bb7f1f9fc762d6e449320069da (diff)
downloadscrott-877eccf539bfd3a365d8658ed63d096a13e57b00.tar.gz
scrott-877eccf539bfd3a365d8658ed63d096a13e57b00.zip
+ Implemented Object::getNewGUID function for Object class
Diffstat (limited to '')
-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;
+ }
}
?>