aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-07 16:56:26 -0700
committerFriendika <info@friendika.com>2011-08-07 16:56:26 -0700
commit1eec10329a4764f132b159e7b1bbf37added6c8a (patch)
tree545c9a280fc5fc6d62f7adfa15e76fb8364c5ecc /include/text.php
parenteea493d1f575871f89ede359a9a216ff4c39ea53 (diff)
downloadvolse-hubzilla-1eec10329a4764f132b159e7b1bbf37added6c8a.tar.gz
volse-hubzilla-1eec10329a4764f132b159e7b1bbf37added6c8a.tar.bz2
volse-hubzilla-1eec10329a4764f132b159e7b1bbf37added6c8a.zip
guid functions
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php
index d53a2ceb9..297383602 100644
--- a/include/text.php
+++ b/include/text.php
@@ -19,11 +19,11 @@ function replace_macros($s,$r) {
}}
-// random hash, 64 chars
+// random hex string, 64 chars max
if(! function_exists('random_string')) {
-function random_string() {
- return(hash('sha256',uniqid(rand(),true)));
+function random_string($size = 64) {
+ return(substr(hash('sha256',uniqid(rand(),true)),0,$size));
}}
/**
@@ -878,7 +878,7 @@ function return_bytes ($size_str) {
}
}}
-function generate_guid() {
+function generate_user_guid() {
$found = true;
do {
$guid = substr(random_string(),0,16);