00001 <?php 00044 require_once 'Object/Freezer/IdGenerator.php'; 00045 00057 class Object_Freezer_IdGenerator_UUID implements Object_Freezer_IdGenerator 00058 { 00066 public function getId() 00067 { 00068 return sprintf( 00069 '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 00070 mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), 00071 mt_rand(0, 0x0fff) | 0x4000, 00072 mt_rand(0, 0x3fff) | 0x8000, 00073 mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) 00074 ); 00075 } 00076 }