<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class RandomUtil { public static function number($w9X69) { $OZPRN = '0123456789'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function string($w9X69) { $OZPRN = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function readableString($w9X69) { $OZPRN = '2345678abcdefghijkmnoprstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function lowerReadableString($w9X69) { return strtolower(self::readableString($w9X69)); } public static function upperReadableString($w9X69) { return strtoupper(self::readableString($w9X69)); } public static function hexString($w9X69) { $OZPRN = '0123456789abcdef'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function lowerString($w9X69) { $OZPRN = '0123456789abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function lowerChar($w9X69) { $OZPRN = 'abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function upperChar($w9X69) { $OZPRN = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function upperString($w9X69) { $OZPRN = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($OZPRN, $w9X69)), 0, $w9X69); } public static function uuid() { return date('Ymd') . '-' . date('Hi') . '-' . date('s') . self::hexString(2) . '-' . self::hexString(4) . '-' . self::hexString(12); } public static function percent($ib3B9) { return rand(0, 99) < $ib3B9; } public static function dateCollection($w9X69 = 10) { goto GFtLa; JT3yj: return $ctQO9; goto DJaEL; GFtLa: $ctQO9 = array(); goto w85jX; EUtWA: for ($JhHfm = $G0Ron - $w9X69 * TimeUtil::MINUTE_PERIOD_DAY; $JhHfm < $G0Ron; $JhHfm += TimeUtil::MINUTE_PERIOD_DAY) { $ctQO9[] = date('Y-m-d', $JhHfm); } goto JT3yj; w85jX: $G0Ron = time(); goto EUtWA; DJaEL: } public static function numberCollection($w9X69 = 10, $RyDaP = 10, $iIKEF = 100) { goto U3KHV; LtjuQ: return $ctQO9; goto qRfJo; U3KHV: $ctQO9 = array(); goto DOrqQ; DOrqQ: for ($JhHfm = 0; $JhHfm < $w9X69; $JhHfm++) { $ctQO9[] = rand($RyDaP, $iIKEF); } goto LtjuQ; qRfJo: } }