diff options
author | Malf Furious <m@lfurio.us> | 2015-12-18 13:52:19 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2015-12-18 13:52:19 -0500 |
commit | 877eccf539bfd3a365d8658ed63d096a13e57b00 (patch) | |
tree | a118ccc722821dd8a81fd90c2030debd704553a5 /app/class/object.class.php | |
parent | 25947336340ac5bb7f1f9fc762d6e449320069da (diff) | |
download | scrott-877eccf539bfd3a365d8658ed63d096a13e57b00.tar.gz scrott-877eccf539bfd3a365d8658ed63d096a13e57b00.zip |
+ Implemented Object::getNewGUID function for Object class
Diffstat (limited to '')
-rw-r--r-- | app/class/object.class.php | 15 |
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; + } } ?> |