<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class NumberUtil { public static function decToD62($KZdY3) { goto xArAY; qhhav: $JOw_A = ''; goto YFZTa; YFZTa: do { $JOw_A = $BLJlV[bcmod($KZdY3, $ygeGW)] . $JOw_A; $KZdY3 = bcdiv($KZdY3, $ygeGW); } while ($KZdY3 > 0); goto HFn3L; xArAY: $ygeGW = 62; goto oLLSy; HFn3L: return $JOw_A; goto fn7PX; oLLSy: $BLJlV = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto qhhav; fn7PX: } public static function d62ToDec($KZdY3) { goto T66h3; a2S3U: for ($eQWJY = 0; $eQWJY < $LN7N0; $eQWJY++) { $te4eV = strpos($BLJlV, $KZdY3[$eQWJY]); $pXrZn = bcadd(bcmul(bcpow($S7Ck8, $LN7N0 - $eQWJY - 1), $te4eV), $pXrZn); } goto tz90b; MKcZi: $KZdY3 = strval($KZdY3); goto P8PhW; tz90b: return $pXrZn; goto JIET_; jXBCy: $pXrZn = 0; goto a2S3U; LY7nM: $LN7N0 = strlen($KZdY3); goto jXBCy; T66h3: $S7Ck8 = 62; goto MKcZi; P8PhW: $BLJlV = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto LY7nM; JIET_: } public static function randomInt($C02ht, $lFwEO) { if ($C02ht == $lFwEO) { return $C02ht; } return rand($C02ht, $lFwEO); } public static function randomDecimal($C02ht, $lFwEO) { goto DUrYr; DUrYr: if ($C02ht == $lFwEO) { return $C02ht; } goto eXuiq; eXuiq: $FT9zA = rand(intval(bcmul($C02ht, 100)), intval(bcmul($lFwEO, 100))); goto weJN0; weJN0: return bcdiv($FT9zA, 100, 2); goto tl_k1; tl_k1: } }