<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($rDHbH = 'Default') { goto f104w; f104w: static $eYURB = array(); goto s39Rh; igBp2: $eYURB[$rDHbH]++; goto OqpAQ; s39Rh: if (empty($eYURB[$rDHbH])) { $eYURB[$rDHbH] = 0; } goto igBp2; OqpAQ: return $rDHbH . '_' . $eYURB[$rDHbH]; goto fL9Am; fL9Am: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($qQ641 = null) { goto Pa3PJ; Gi01V: do { $kpbbP = intval(microtime(true) * 10000); if ($kpbbP !== $nK_er) { $t_BK6 = 0; } } while ($t_BK6 >= 1000); goto vfwGJ; vfwGJ: $nK_er = $kpbbP; goto Guxm0; Pa3PJ: static $nK_er = null; goto NKf0d; OObAe: $vhAk5 = $qQ641 % 10; goto jlLwA; inE9v: return $kpbbP . $vhAk5 . $Paa7L . sprintf('%03d', $t_BK6++); goto Ci8kW; tmDUX: static $Paa7L = null; goto Gi01V; jlLwA: if (null === $Paa7L) { $Paa7L = rand(0, 9); } goto inE9v; NKf0d: static $t_BK6 = 0; goto tmDUX; Guxm0: if ($qQ641 === null) { $qQ641 = getmypid(); } goto OObAe; Ci8kW: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }