<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($ky_TL = 'Default') { goto l5RbQ; qYVQC: $S904X[$ky_TL]++; goto xC6fE; xC6fE: return $ky_TL . '_' . $S904X[$ky_TL]; goto dU1KQ; l5RbQ: static $S904X = array(); goto SwyZc; SwyZc: if (empty($S904X[$ky_TL])) { $S904X[$ky_TL] = 0; } goto qYVQC; dU1KQ: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($zHMEP = null) { goto WWlmF; WWlmF: static $U_J_J = null; goto lTxR0; i3kaL: $AV4BV = $zHMEP % 10; goto pOTCI; koC4Y: if ($zHMEP === null) { $zHMEP = getmypid(); } goto i3kaL; aLQn8: static $EfECe = null; goto qTf2C; Udgto: return $TRQ03 . $AV4BV . $EfECe . sprintf('%03d', $tHrR8++); goto UjFow; lh8D0: $U_J_J = $TRQ03; goto koC4Y; lTxR0: static $tHrR8 = 0; goto aLQn8; pOTCI: if (null === $EfECe) { $EfECe = rand(0, 9); } goto Udgto; qTf2C: do { $TRQ03 = intval(microtime(true) * 10000); if ($TRQ03 !== $U_J_J) { $tHrR8 = 0; } } while ($tHrR8 >= 1000); goto lh8D0; UjFow: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }