summaryrefslogtreecommitdiffstats
path: root/app/class/object.class.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/class/object.class.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php
index 93b52f0..96cc810 100644
--- a/app/class/object.class.php
+++ b/app/class/object.class.php
@@ -214,13 +214,20 @@ abstract class Object extends Framework
{
do
{
- $sha = hash("sha256", rand());
- $guid = substr($sha, 0, 8);
+ $guid = substr($this->getBlob(), 0, 8);
}
while ($this->isGUID($guid));
return $guid;
}
+
+ /*
+ * Get a random sha256 blob
+ */
+ function getBlob()
+ {
+ return hash("sha256", openssl_random_pseudo_bytes(64));
+ }
}
/*