function chart_graphs_random_hash in Charts and Graphs 6
Random, unique string generator, to be used for cache_id in async data retrieval.
Return value
<string>
2 calls to chart_graphs_random_hash()
- ChartsAmcharts::get_chart in apis/
amcharts/ amcharts.class.inc - Function that renders data.
- ChartsOpenFlash::get_chart in apis/
charts_openflash/ charts_openflash.class.inc - Function that renders data.
File
- ./
charts_graphs.module, line 136
Code
function chart_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;
}