<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($bg3WE = 'Default') { goto xEtls; WxD2X: if (empty($yW3Iq[$bg3WE])) { $yW3Iq[$bg3WE] = 0; } goto pwAI6; pwAI6: $yW3Iq[$bg3WE]++; goto Jt0F5; Jt0F5: return $bg3WE . '_' . $yW3Iq[$bg3WE]; goto uYJOp; xEtls: static $yW3Iq = array(); goto WxD2X; uYJOp: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($VHIqf = null) { goto EA2r7; Yr4Cy: return $Fcarx . $Iw9mm . $YtLtM . sprintf('%03d', $Hjgqz++); goto Al6G0; RuIe3: do { $Fcarx = intval(microtime(true) * 10000); if ($Fcarx !== $UNOE3) { $Hjgqz = 0; } } while ($Hjgqz >= 1000); goto hPaCc; GHseo: $Iw9mm = $VHIqf % 10; goto XEhtb; hPaCc: $UNOE3 = $Fcarx; goto br7zf; g2wzd: static $YtLtM = null; goto RuIe3; br7zf: if ($VHIqf === null) { $VHIqf = getmypid(); } goto GHseo; nIH7s: static $Hjgqz = 0; goto g2wzd; EA2r7: static $UNOE3 = null; goto nIH7s; XEhtb: if (null === $YtLtM) { $YtLtM = rand(0, 9); } goto Yr4Cy; Al6G0: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }