<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class NumberUtil { public static function decToD62($ymfpP) { goto M7XU8; OzmLY: $yd0j0 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto B0nwb; M7XU8: $WLsPA = 62; goto OzmLY; B0nwb: $ZIe4d = ''; goto rDFt7; amIP9: return $ZIe4d; goto l4KwP; rDFt7: do { $ZIe4d = $yd0j0[bcmod($ymfpP, $WLsPA)] . $ZIe4d; $ymfpP = bcdiv($ymfpP, $WLsPA); } while ($ymfpP > 0); goto amIP9; l4KwP: } public static function d62ToDec($ymfpP) { goto j9oSX; g_rbx: $yd0j0 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto lA3Pu; j9oSX: $lmF4G = 62; goto Q5Zns; bo3dv: $t5Wqo = 0; goto j0A_V; Q5Zns: $ymfpP = strval($ymfpP); goto g_rbx; T7YMO: return $t5Wqo; goto Rcd3L; lA3Pu: $OyL3Z = strlen($ymfpP); goto bo3dv; j0A_V: for ($kM8qX = 0; $kM8qX < $OyL3Z; $kM8qX++) { $Ct3f7 = strpos($yd0j0, $ymfpP[$kM8qX]); $t5Wqo = bcadd(bcmul(bcpow($lmF4G, $OyL3Z - $kM8qX - 1), $Ct3f7), $t5Wqo); } goto T7YMO; Rcd3L: } public static function randomInt($Afo5Z, $SB93Q) { if ($Afo5Z == $SB93Q) { return $Afo5Z; } return rand($Afo5Z, $SB93Q); } public static function randomDecimal($Afo5Z, $SB93Q) { goto HV_6Z; C1yUc: $Mczr_ = rand(intval(bcmul($Afo5Z, 100)), intval(bcmul($SB93Q, 100))); goto kj3dA; kj3dA: return bcdiv($Mczr_, 100, 2); goto NP2u1; HV_6Z: if ($Afo5Z == $SB93Q) { return $Afo5Z; } goto C1yUc; NP2u1: } public static function numToZH($YVPBs) { goto C7O21; UM8LA: $WqCf1 = ''; goto isiD0; gfOtR: $BnTD4 = array('', '十', '百', '千', '万', '亿'); goto cVapm; cVapm: if ($YVPBs == 0) { return $ZP3cp[0]; } goto jX32A; isiD0: for ($kM8qX = 0; $kM8qX < $rsM2m; $kM8qX++) { $qEFub = (int) $wtGvZ[$kM8qX]; $Y_oWh = $rsM2m - $kM8qX - 1; if ($qEFub != 0) { $WqCf1 .= $ZP3cp[$qEFub] . $BnTD4[$Y_oWh]; } else { if ($WqCf1[strlen($WqCf1) - 1] !== $ZP3cp[0]) { $WqCf1 .= $ZP3cp[$qEFub]; } } } goto x8ouM; hVAJi: $rsM2m = strlen($wtGvZ); goto UM8LA; x8ouM: if ($rsM2m > 1 && $wtGvZ[0] == 1 && $WqCf1[0] == $ZP3cp[1]) { $WqCf1 = substr($WqCf1, 1); } goto mzqkp; C7O21: $ZP3cp = array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九'); goto gfOtR; jX32A: $wtGvZ = strval($YVPBs); goto hVAJi; mzqkp: return $WqCf1; goto xr_IN; xr_IN: } }