<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($o12RE = 'Default') { goto SlKuu; SlKuu: static $NRcb0 = array(); goto v34HX; xFmq_: return $o12RE . '_' . $NRcb0[$o12RE]; goto GG_P_; v34HX: if (empty($NRcb0[$o12RE])) { $NRcb0[$o12RE] = 0; } goto jnFEE; jnFEE: $NRcb0[$o12RE]++; goto xFmq_; GG_P_: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($auNaC = null) { goto cIRJb; x2Uy1: if ($auNaC === null) { $auNaC = getmypid(); } goto pIga7; Oi6WC: static $pNhPS = 0; goto scMtV; scMtV: static $N0XXz = null; goto fXlHC; WatoK: if (null === $N0XXz) { $N0XXz = rand(0, 9); } goto nbdKe; pIga7: $rT28h = $auNaC % 10; goto WatoK; nbdKe: return $YyV6N . $rT28h . $N0XXz . sprintf('%03d', $pNhPS++); goto WGpVB; RpwQA: $t80k7 = $YyV6N; goto x2Uy1; cIRJb: static $t80k7 = null; goto Oi6WC; fXlHC: do { $YyV6N = intval(microtime(true) * 10000); if ($YyV6N !== $t80k7) { $pNhPS = 0; } } while ($pNhPS >= 1000); goto RpwQA; WGpVB: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }