<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class RandomUtil { public static function number($S5RIP) { $St_Ih = '0123456789'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function string($S5RIP) { $St_Ih = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function readableString($S5RIP) { $St_Ih = '2345678abcdefghijkmnoprstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function lowerReadableString($S5RIP) { return strtolower(self::readableString($S5RIP)); } public static function upperReadableString($S5RIP) { return strtoupper(self::readableString($S5RIP)); } public static function hexString($S5RIP) { $St_Ih = '0123456789abcdef'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function lowerString($S5RIP) { $St_Ih = '0123456789abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function lowerChar($S5RIP) { $St_Ih = 'abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function upperChar($S5RIP) { $St_Ih = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function upperString($S5RIP) { $St_Ih = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($St_Ih, $S5RIP)), 0, $S5RIP); } public static function uuid() { return date('Ymd') . '-' . date('Hi') . '-' . date('s') . self::hexString(2) . '-' . self::hexString(4) . '-' . self::hexString(12); } public static function percent($Mczr_) { return rand(0, 99) < $Mczr_; } public static function dateCollection($S5RIP = 10) { goto GxNWc; av0ii: for ($kM8qX = $f3YYx - $S5RIP * TimeUtil::MINUTE_PERIOD_DAY; $kM8qX < $f3YYx; $kM8qX += TimeUtil::MINUTE_PERIOD_DAY) { $AG1dZ[] = date('Y-m-d', $kM8qX); } goto I1Ukm; pMHq9: $f3YYx = time(); goto av0ii; GxNWc: $AG1dZ = array(); goto pMHq9; I1Ukm: return $AG1dZ; goto aB2dO; aB2dO: } public static function numberCollection($S5RIP = 10, $Afo5Z = 10, $SB93Q = 100) { goto r0XD7; g2fep: for ($kM8qX = 0; $kM8qX < $S5RIP; $kM8qX++) { $AG1dZ[] = rand($Afo5Z, $SB93Q); } goto DpTSI; DpTSI: return $AG1dZ; goto tbASR; r0XD7: $AG1dZ = array(); goto g2fep; tbASR: } }