<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class NumberUtil { public static function decToD62($vK1fV) { goto M2qrm; BJUos: do { $N2Xaa = $rJXv0[bcmod($vK1fV, $hjIzo)] . $N2Xaa; $vK1fV = bcdiv($vK1fV, $hjIzo); } while ($vK1fV > 0); goto oqlQZ; H7Hj3: $rJXv0 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto uDk17; M2qrm: $hjIzo = 62; goto H7Hj3; uDk17: $N2Xaa = ''; goto BJUos; oqlQZ: return $N2Xaa; goto xyXYK; xyXYK: } public static function d62ToDec($vK1fV) { goto CwscE; T5JOE: $vK1fV = strval($vK1fV); goto lgCCA; J0r_S: $X2amD = strlen($vK1fV); goto nAfFf; CwscE: $FtI8I = 62; goto T5JOE; zXgRC: return $eoeAh; goto AmJO9; nAfFf: $eoeAh = 0; goto Ri3T9; Ri3T9: for ($Xn_Rr = 0; $Xn_Rr < $X2amD; $Xn_Rr++) { $K4iOA = strpos($rJXv0, $vK1fV[$Xn_Rr]); $eoeAh = bcadd(bcmul(bcpow($FtI8I, $X2amD - $Xn_Rr - 1), $K4iOA), $eoeAh); } goto zXgRC; lgCCA: $rJXv0 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto J0r_S; AmJO9: } public static function randomInt($nXoKt, $muYdQ) { if ($nXoKt == $muYdQ) { return $nXoKt; } return rand($nXoKt, $muYdQ); } public static function randomDecimal($nXoKt, $muYdQ) { goto hAb_g; AKBtw: return bcdiv($mdHu1, 100, 2); goto j5KlJ; ugyMK: $mdHu1 = rand(intval(bcmul($nXoKt, 100)), intval(bcmul($muYdQ, 100))); goto AKBtw; hAb_g: if ($nXoKt == $muYdQ) { return $nXoKt; } goto ugyMK; j5KlJ: } public static function numToZH($wyvQZ) { goto FttpH; nsQgo: if ($eEZzQ > 1 && $pk_13[0] == 1 && $LFzZs[0] == $rktA8[1]) { $LFzZs = substr($LFzZs, 1); } goto BP6cJ; qU8_O: $pk_13 = strval($wyvQZ); goto Frjz1; O0k0I: $LFzZs = ''; goto HTXpZ; QR75x: $CiApg = array('', '十', '百', '千', '万', '亿'); goto kOPd_; HTXpZ: for ($Xn_Rr = 0; $Xn_Rr < $eEZzQ; $Xn_Rr++) { $Jegam = (int) $pk_13[$Xn_Rr]; $v5w6q = $eEZzQ - $Xn_Rr - 1; if ($Jegam != 0) { $LFzZs .= $rktA8[$Jegam] . $CiApg[$v5w6q]; } else { if ($LFzZs[strlen($LFzZs) - 1] !== $rktA8[0]) { $LFzZs .= $rktA8[$Jegam]; } } } goto nsQgo; Frjz1: $eEZzQ = strlen($pk_13); goto O0k0I; FttpH: $rktA8 = array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九'); goto QR75x; BP6cJ: return $LFzZs; goto v2Ctw; kOPd_: if ($wyvQZ == 0) { return $rktA8[0]; } goto qU8_O; v2Ctw: } }