<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class IdUtil { public static function generate($RpVCk = 'Default') { goto CIJZP; FBN7F: $SRxBF[$RpVCk]++; goto nQnbH; nQnbH: return $RpVCk . '_' . $SRxBF[$RpVCk]; goto l1Hw3; CIJZP: static $SRxBF = array(); goto bAugN; bAugN: if (empty($SRxBF[$RpVCk])) { $SRxBF[$RpVCk] = 0; } goto FBN7F; l1Hw3: } public static function next64BitId() { return intval(microtime(true) * 10000) . getmypid() % 10 . sprintf('%04d', rand(0, 9999)); } public static function next64BitIdSeq($lA7fy = null) { goto ylGlG; XRkUC: if (null === $gkHtX) { $gkHtX = rand(0, 9); } goto UDOf2; VKkz0: do { $tfKvy = intval(microtime(true) * 10000); if ($tfKvy !== $JOcYp) { $miXoN = 0; } } while ($miXoN >= 1000); goto VI2mD; VI2mD: $JOcYp = $tfKvy; goto TcxzG; ylGlG: static $JOcYp = null; goto n7ZKn; RvsC2: $keMxr = $lA7fy % 10; goto XRkUC; n7ZKn: static $miXoN = 0; goto LXlzh; UDOf2: return $tfKvy . $keMxr . $gkHtX . sprintf('%03d', $miXoN++); goto hW3II; TcxzG: if ($lA7fy === null) { $lA7fy = getmypid(); } goto RvsC2; LXlzh: static $gkHtX = null; goto VKkz0; hW3II: } public static function generateSN() { return date('YmdHis', time()) . sprintf('%05d', rand(0, 99999)); } }