<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class RandomUtil { public static function number($D6DE7) { $sgNSn = '0123456789'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function string($D6DE7) { $sgNSn = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function readableString($D6DE7) { $sgNSn = '2345678abcdefghijkmnoprstuvwxyzABCDEFGHIJKMNPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function lowerReadableString($D6DE7) { return strtolower(self::readableString($D6DE7)); } public static function upperReadableString($D6DE7) { return strtoupper(self::readableString($D6DE7)); } public static function hexString($D6DE7) { $sgNSn = '0123456789abcdef'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function lowerString($D6DE7) { $sgNSn = '0123456789abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function lowerChar($D6DE7) { $sgNSn = 'abcdefghijklmnopqrstuvwxyz'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function upperChar($D6DE7) { $sgNSn = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function upperString($D6DE7) { $sgNSn = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; return substr(str_shuffle(str_repeat($sgNSn, $D6DE7)), 0, $D6DE7); } public static function uuid() { return date('Ymd') . '-' . date('Hi') . '-' . date('s') . self::hexString(2) . '-' . self::hexString(4) . '-' . self::hexString(12); } public static function percent($Gttsd) { return rand(0, 99) < $Gttsd; } public static function dateCollection($D6DE7 = 10) { goto MqlDW; MqlDW: $Nq2Ir = array(); goto gqU0M; Bs1JD: return $Nq2Ir; goto U3Vcp; gqU0M: $KpVmd = time(); goto r7d0y; r7d0y: for ($MqJHJ = $KpVmd - $D6DE7 * TimeUtil::MINUTE_PERIOD_DAY; $MqJHJ < $KpVmd; $MqJHJ += TimeUtil::MINUTE_PERIOD_DAY) { $Nq2Ir[] = date('Y-m-d', $MqJHJ); } goto Bs1JD; U3Vcp: } public static function numberCollection($D6DE7 = 10, $iZRpz = 10, $XxbtD = 100) { goto Bayr5; x8p2c: for ($MqJHJ = 0; $MqJHJ < $D6DE7; $MqJHJ++) { $Nq2Ir[] = rand($iZRpz, $XxbtD); } goto lrpr8; lrpr8: return $Nq2Ir; goto Bz4tf; Bayr5: $Nq2Ir = array(); goto x8p2c; Bz4tf: } }