<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($ElG57 = 'Default') { goto rgV04; b6wPN: if (empty($PGfuX[$ElG57])) { $PGfuX[$ElG57] = 0; } goto WxEzm; WxEzm: $PGfuX[$ElG57]++; goto gD3W8; gD3W8: return $ElG57 . '_' . $PGfuX[$ElG57]; goto N9mto; rgV04: static $PGfuX = array(); goto b6wPN; N9mto: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($spkWl = null) { goto ZVppM; Y90Bo: if (null === $VxJ3x) { $VxJ3x = rand(0, 9); } goto IOlp0; IOlp0: return $XK2yJ . $TBQx0 . $VxJ3x . sprintf('%03d', $SAQEM++); goto MNX_z; tz9Bg: $TBQx0 = $spkWl % 10; goto Y90Bo; xGSz2: do { $XK2yJ = intval(microtime(true) * 10000); if ($XK2yJ !== $aGi0m) { $SAQEM = 0; } } while ($SAQEM >= 1000); goto er0du; er0du: $aGi0m = $XK2yJ; goto dAe6i; dAe6i: if ($spkWl === null) { $spkWl = getmypid(); } goto tz9Bg; ZVppM: static $aGi0m = null; goto ugBtW; ugBtW: static $SAQEM = 0; goto WeVSU; WeVSU: static $VxJ3x = null; goto xGSz2; MNX_z: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }