You are here

function ga_push_method_php_utmp_gen_uuid in GA Push 8

Same name and namespace in other branches
  1. 7 inc/ga_push.utmp.php.inc \ga_push_method_php_utmp_gen_uuid()

Generates an UUID ver 4 identifier.

Thanks to Andrew Mooer at php.net. http://www.php.net/manual/en/function.uniqid.php#94959

Return value

string UUID.

1 call to ga_push_method_php_utmp_gen_uuid()
ga_push_method_php_utmp_get_uuid in inc/ga_push.utmp.php.inc
Get an UUID ver 4 identifier form cookie or generates one on fallback.

File

inc/ga_push.utmp.php.inc, line 271
UTMP: method and functions for Universal Tracking Measure Protocol.

Code

function ga_push_method_php_utmp_gen_uuid() {
  return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
}