<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class NumberUtil { public static function decToD62($C_MSm) { goto Jad4I; b8LDE: $UdQ1p = ''; goto Fx875; Jad4I: $blQsO = 62; goto GF1dy; iUp54: return $UdQ1p; goto IhqEP; Fx875: do { $UdQ1p = $eEzU0[bcmod($C_MSm, $blQsO)] . $UdQ1p; $C_MSm = bcdiv($C_MSm, $blQsO); } while ($C_MSm > 0); goto iUp54; GF1dy: $eEzU0 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto b8LDE; IhqEP: } public static function d62ToDec($C_MSm) { goto v1_hj; cPAAx: $eEzU0 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto nWi1D; AKjWR: return $WqwDU; goto Ybr0n; v1_hj: $SoJ1U = 62; goto a1Fo5; ZwjYD: for ($VJ5vg = 0; $VJ5vg < $ayP7s; $VJ5vg++) { $M0xb7 = strpos($eEzU0, $C_MSm[$VJ5vg]); $WqwDU = bcadd(bcmul(bcpow($SoJ1U, $ayP7s - $VJ5vg - 1), $M0xb7), $WqwDU); } goto AKjWR; nWi1D: $ayP7s = strlen($C_MSm); goto lHMEw; a1Fo5: $C_MSm = strval($C_MSm); goto cPAAx; lHMEw: $WqwDU = 0; goto ZwjYD; Ybr0n: } public static function randomInt($VRHMd, $mymfi) { if ($VRHMd == $mymfi) { return $VRHMd; } return rand($VRHMd, $mymfi); } public static function randomDecimal($VRHMd, $mymfi) { goto iP0ft; iP0ft: if ($VRHMd == $mymfi) { return $VRHMd; } goto JfyuA; JfyuA: $gwXrh = rand(intval(bcmul($VRHMd, 100)), intval(bcmul($mymfi, 100))); goto YSMMd; YSMMd: return bcdiv($gwXrh, 100, 2); goto jyUED; jyUED: } public static function numToZH($TmsXf) { goto ajbFG; A2lgN: if ($TmsXf == 0) { return $tSIka[0]; } goto UKKhX; U3VXi: $mftV2 = array('', '十', '百', '千', '万', '亿'); goto A2lgN; UKKhX: $G0yZK = strval($TmsXf); goto YEUBm; zsEGD: for ($VJ5vg = 0; $VJ5vg < $atix_; $VJ5vg++) { $i7tuP = (int) $G0yZK[$VJ5vg]; $gEYuf = $atix_ - $VJ5vg - 1; if ($i7tuP != 0) { $Iy3i6 .= $tSIka[$i7tuP] . $mftV2[$gEYuf]; } else { if ($Iy3i6[strlen($Iy3i6) - 1] !== $tSIka[0]) { $Iy3i6 .= $tSIka[$i7tuP]; } } } goto cEddy; cEddy: if ($atix_ > 1 && $G0yZK[0] == 1 && $Iy3i6[0] == $tSIka[1]) { $Iy3i6 = substr($Iy3i6, 1); } goto KMLFl; KMLFl: return $Iy3i6; goto kUVuB; CKQQj: $Iy3i6 = ''; goto zsEGD; ajbFG: $tSIka = array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九'); goto U3VXi; YEUBm: $atix_ = strlen($G0yZK); goto CKQQj; kUVuB: } }