<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($F0_Ro = 'Default') { goto HcemA; pxtIA: return $F0_Ro . '_' . $gROn3[$F0_Ro]; goto j_ml5; UYFCh: $gROn3[$F0_Ro]++; goto pxtIA; brhA8: if (empty($gROn3[$F0_Ro])) { $gROn3[$F0_Ro] = 0; } goto UYFCh; HcemA: static $gROn3 = array(); goto brhA8; j_ml5: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($omkkQ = null) { goto zOd1N; zIXUp: static $R4P_M = 0; goto DkMGs; lMAKh: if (null === $Ep6FK) { $Ep6FK = rand(0, 9); } goto QiWzx; mZICv: $p0z2i = $PmxdV; goto BqAKm; AfQY5: $Fw_ae = $omkkQ % 10; goto lMAKh; uoVvP: do { $PmxdV = intval(microtime(true) * 10000); if ($PmxdV !== $p0z2i) { $R4P_M = 0; } } while ($R4P_M >= 1000); goto mZICv; zOd1N: static $p0z2i = null; goto zIXUp; BqAKm: if ($omkkQ === null) { $omkkQ = getmypid(); } goto AfQY5; QiWzx: return $PmxdV . $Fw_ae . $Ep6FK . sprintf('%03d', $R4P_M++); goto oYiPr; DkMGs: static $Ep6FK = null; goto uoVvP; oYiPr: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }