function charts_graphs_random_hash in Charts and Graphs 7.2
Same name and namespace in other branches
- 6.2 charts_graphs.module \charts_graphs_random_hash()
- 7 charts_graphs.module \charts_graphs_random_hash()
Random, unique string generator, to be used for cache_id in async data retrieval.
Return value
<string>
File
- ./
charts_graphs.module, line 236
Code
function charts_graphs_random_hash() {
list($usec, $sec) = explode(' ', microtime());
$seed = (double) $sec + (double) $usec * 100000;
mt_srand($seed);
$randval1 = (string) mt_rand();
$randval2 = (string) mt_rand();
$randval3 = (string) mt_rand();
$rand = $randval1 . $randval2 . $randval3;
$randhash = md5($rand);
return 'chgr_' . (string) $randhash;
}