carbonPHP Initial commit v2.0
[carbonphp.git] / Source / carbon / utilities / uuid_utility.php
blobb159de92a95eedee85687876bad4f093eceb61bd
1 <?php
2 /*------------------------------------------------------------
3 * CarbonPHP framework (C) Tom Bell
4 * http://tombell.org.uk
5 *------------------------------------------------------------*/
7 if (!defined('CARBON_PATH'))
9 exit('Direct script access is not allowed.');
12 function generate_uuid($system_id)
14 $rnd_id = crypt(uniqid(rand(), 1));
15 $rnd_id = strip_tags(stripslashes($rnd_id));
16 $rnd_id = str_replace(array(".", "/"), array("", ""), $rnd_id);
17 $rnd_id = strrev($rnd_id);
18 $rnd_id = substr($rnd_id, 0, 8);
19 $rnd_id = $system_id . $rnd_id;
21 return $rnd_id;