<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($yl4YA = 'Default') { goto rcB58; lzgJs: if (empty($NnNhz[$yl4YA])) { $NnNhz[$yl4YA] = 0; } goto gzTpx; gzTpx: $NnNhz[$yl4YA]++; goto QK633; QK633: return $yl4YA . '_' . $NnNhz[$yl4YA]; goto pDn9W; rcB58: static $NnNhz = array(); goto lzgJs; pDn9W: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($QdCYE = null) { goto hzERF; ZUJzz: if ($QdCYE === null) { $QdCYE = getmypid(); } goto Wd95X; jJqhz: static $wvrj6 = 0; goto IObKt; hzERF: static $QaCFr = null; goto jJqhz; KzstK: return $PVm_Y . $n35mQ . $noBP1 . sprintf('%03d', $wvrj6++); goto zJAKH; Wd95X: $n35mQ = $QdCYE % 10; goto YjsRb; sq3Uq: do { $PVm_Y = intval(microtime(true) * 10000); if ($PVm_Y !== $QaCFr) { $wvrj6 = 0; } } while ($wvrj6 >= 1000); goto JUMu6; JUMu6: $QaCFr = $PVm_Y; goto ZUJzz; YjsRb: if (null === $noBP1) { $noBP1 = rand(0, 9); } goto KzstK; IObKt: static $noBP1 = null; goto sq3Uq; zJAKH: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }