<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class RandomUtil { public static function number($RcxR9) { $VHHJQ = '0123456789'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function string($RcxR9) { $VHHJQ = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function readableString($RcxR9) { $VHHJQ = '2345678abcdefghijkmnoprstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function lowerReadableString($RcxR9) { return strtolower(self::readableString($RcxR9)); } public static function upperReadableString($RcxR9) { return strtoupper(self::readableString($RcxR9)); } public static function hexString($RcxR9) { $VHHJQ = '0123456789abcdef'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function lowerString($RcxR9) { $VHHJQ = '0123456789abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function lowerChar($RcxR9) { $VHHJQ = 'abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function upperChar($RcxR9) { $VHHJQ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function upperString($RcxR9) { $VHHJQ = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($VHHJQ, $RcxR9)), 0, $RcxR9); } public static function uuid() { return date('Ymd') . '-' . date('Hi') . '-' . date('s') . self::hexString(2) . '-' . self::hexString(4) . '-' . self::hexString(12); } public static function percent($mdHu1) { return rand(0, 99) < $mdHu1; } public static function dateCollection($RcxR9 = 10) { goto IhOOY; wMNF2: return $HBiwi; goto gTGlA; YgMSA: $Ku2V9 = time(); goto z7m9I; IhOOY: $HBiwi = array(); goto YgMSA; z7m9I: for ($Xn_Rr = $Ku2V9 - $RcxR9 * TimeUtil::MINUTE_PERIOD_DAY; $Xn_Rr < $Ku2V9; $Xn_Rr += TimeUtil::MINUTE_PERIOD_DAY) { $HBiwi[] = date('Y-m-d', $Xn_Rr); } goto wMNF2; gTGlA: } public static function numberCollection($RcxR9 = 10, $nXoKt = 10, $muYdQ = 100) { goto R7ONS; uibLs: return $HBiwi; goto bO4Z1; R7ONS: $HBiwi = array(); goto sPu9u; sPu9u: for ($Xn_Rr = 0; $Xn_Rr < $RcxR9; $Xn_Rr++) { $HBiwi[] = rand($nXoKt, $muYdQ); } goto uibLs; bO4Z1: } }