<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class NumberUtil { public static function decToD62($d4qFg) { goto QL9eT; T3anG: do { $pTwJr = $ty22C[bcmod($d4qFg, $QCEgc)] . $pTwJr; $d4qFg = bcdiv($d4qFg, $QCEgc); } while ($d4qFg > 0); goto cJP_o; QL9eT: $QCEgc = 62; goto QuSst; QuSst: $ty22C = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto Ry_K8; cJP_o: return $pTwJr; goto J4HDo; Ry_K8: $pTwJr = ''; goto T3anG; J4HDo: } public static function d62ToDec($d4qFg) { goto n9MGN; PLQED: return $eJeqr; goto ikZC7; LbRED: $d4qFg = strval($d4qFg); goto DFH0t; DFH0t: $ty22C = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; goto WMrTU; WMrTU: $X3JA1 = strlen($d4qFg); goto ZR5J0; ZR5J0: $eJeqr = 0; goto AFG5s; n9MGN: $KUvwa = 62; goto LbRED; AFG5s: for ($UCcmA = 0; $UCcmA < $X3JA1; $UCcmA++) { $RzkJP = strpos($ty22C, $d4qFg[$UCcmA]); $eJeqr = bcadd(bcmul(bcpow($KUvwa, $X3JA1 - $UCcmA - 1), $RzkJP), $eJeqr); } goto PLQED; ikZC7: } public static function randomInt($ovAVz, $it8Qi) { if ($ovAVz == $it8Qi) { return $ovAVz; } return rand($ovAVz, $it8Qi); } public static function randomDecimal($ovAVz, $it8Qi) { goto gYWI7; gYWI7: if ($ovAVz == $it8Qi) { return $ovAVz; } goto FQMxg; hVOSa: return bcdiv($wvO30, 100, 2); goto hrck6; FQMxg: $wvO30 = rand(intval(bcmul($ovAVz, 100)), intval(bcmul($it8Qi, 100))); goto hVOSa; hrck6: } public static function numToZH($f6hAA) { goto dRzIA; NOMwa: return $h2tHc; goto jV2MI; dRzIA: $yNij4 = array('零', '一', '二', '三', '四', '五', '六', '七', '八', '九'); goto S11I9; a5gvc: if ($bA3hr > 1 && $VEPqz[0] == 1 && $h2tHc[0] == $yNij4[1]) { $h2tHc = substr($h2tHc, 1); } goto NOMwa; f98bi: $VEPqz = strval($f6hAA); goto OUev7; VlSfN: $h2tHc = ''; goto KmmCs; B1ULo: if ($f6hAA == 0) { return $yNij4[0]; } goto f98bi; S11I9: $K3z09 = array('', '十', '百', '千', '万', '亿'); goto B1ULo; KmmCs: for ($UCcmA = 0; $UCcmA < $bA3hr; $UCcmA++) { $D0Qct = (int) $VEPqz[$UCcmA]; $SdXnf = $bA3hr - $UCcmA - 1; if ($D0Qct != 0) { $h2tHc .= $yNij4[$D0Qct] . $K3z09[$SdXnf]; } else { if ($h2tHc[strlen($h2tHc) - 1] !== $yNij4[0]) { $h2tHc .= $yNij4[$D0Qct]; } } } goto a5gvc; OUev7: $bA3hr = strlen($VEPqz); goto VlSfN; jV2MI: } }