<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class NumberUtil { public static function decToD62($bmtCP) { goto ib_5s; ib_5s: $RP3dD = 62; goto FpHP6; FpHP6: $brbYW = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto c5xj6; c5xj6: $f3Nqc = ''; goto p0O8Z; p0O8Z: do { $f3Nqc = $brbYW[bcmod($bmtCP, $RP3dD)] . $f3Nqc; $bmtCP = bcdiv($bmtCP, $RP3dD); } while ($bmtCP > 0); goto Q0jxP; Q0jxP: return $f3Nqc; goto x9KjZ; x9KjZ: } public static function d62ToDec($bmtCP) { goto vhN7n; DN1tj: $lDJHI = strlen($bmtCP); goto ThGdf; ThGdf: $HxqQD = 0; goto PqiMl; vhN7n: $L_a53 = 62; goto aB5o3; aB5o3: $bmtCP = strval($bmtCP); goto w6mdE; PqiMl: for ($MqJHJ = 0; $MqJHJ < $lDJHI; $MqJHJ++) { $ghpAa = strpos($brbYW, $bmtCP[$MqJHJ]); $HxqQD = bcadd(bcmul(bcpow($L_a53, $lDJHI - $MqJHJ - 1), $ghpAa), $HxqQD); } goto DoW41; w6mdE: $brbYW = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto DN1tj; DoW41: return $HxqQD; goto ZEZ6f; ZEZ6f: } public static function randomInt($iZRpz, $XxbtD) { if ($iZRpz == $XxbtD) { return $iZRpz; } return rand($iZRpz, $XxbtD); } public static function randomDecimal($iZRpz, $XxbtD) { goto oZzeC; oZzeC: if ($iZRpz == $XxbtD) { return $iZRpz; } goto PnKij; PnKij: $Gttsd = rand(intval(bcmul($iZRpz, 100)), intval(bcmul($XxbtD, 100))); goto d6pWs; d6pWs: return bcdiv($Gttsd, 100, 2); goto Ia0It; Ia0It: } public static function numToZH($BxkG3) { goto pAiOW; OacJ2: if ($BxkG3 == 0) { return $tvn4p[0]; } goto LzrvI; DGWn0: $trLLJ = ''; goto l6MJq; LNJGv: if ($Z4nIS > 1 && $gTCU1[0] == 1 && $trLLJ[0] == $tvn4p[1]) { $trLLJ = substr($trLLJ, 1); } goto ym3FM; l6MJq: for ($MqJHJ = 0; $MqJHJ < $Z4nIS; $MqJHJ++) { $nn66K = (int) $gTCU1[$MqJHJ]; $QdAZ_ = $Z4nIS - $MqJHJ - 1; if ($nn66K != 0) { $trLLJ .= $tvn4p[$nn66K] . $QG9uw[$QdAZ_]; } else { if ($trLLJ[strlen($trLLJ) - 1] !== $tvn4p[0]) { $trLLJ .= $tvn4p[$nn66K]; } } } goto LNJGv; LzrvI: $gTCU1 = strval($BxkG3); goto DGqKu; pAiOW: $tvn4p = array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九'); goto N2QGq; DGqKu: $Z4nIS = strlen($gTCU1); goto DGWn0; N2QGq: $QG9uw = array('', '十', '百', '千', '万', '亿'); goto OacJ2; ym3FM: return $trLLJ; goto WNtMv; WNtMv: } }