original_string: protected function IPLongBaseConvert($long, $fromBase=10, $toBase=36)
      {
          $str = trim($long);
          if (intval($fromBase) != 10) {
              $len = strlen($str);
              $q = 0;
              for ($i=0; $i<$len; $i++) {
                  $r = base_convert($str[$i], $fromBase, 10);
                  $q = bcadd(bcmul($q, $fromBase), $r);
              }
          } else {
              $q = $str;
          }
  
          if (intval($toBase) != 10) {
              $s = '';
              while (bccomp($q, '0', 0) > 0) {
                  $r = intval(bcmod($q, $toBase));
                  $s = base_convert($r, 10, $toBase) . $s;
                  $q = bcdiv($q, $toBase, 0);
              }
          } else {
              $s = $q;
          }
  
          return $s;
      }
code: protected function IPLongBaseConvert($long, $fromBase=10, $toBase=36)
      {
          $str = trim($long);
          if (intval($fromBase) != 10) {
              $len = strlen($str);
              $q = 0;
              for ($i=0; $i<$len; $i++) {
                  $r = base_convert($str[$i], $fromBase, 10);
                  $q = bcadd(bcmul($q, $fromBase), $r);
              }
          } else {
              $q = $str;
          }
  
          if (intval($toBase) != 10) {
              $s = '';
              while (bccomp($q, '0', 0) > 0) {
                  $r = intval(bcmod($q, $toBase));
                  $s = base_convert($r, 10, $toBase) . $s;
                  $q = bcdiv($q, $toBase, 0);
              }
          } else {
              $s = $q;
          }
  
          return $s;
      }
code_tokens: protected function IPLongBaseConvert ( $ long , $ fromBase = 10 , $ toBase = 36 ) { $ str = trim ( $ long ) ; if ( intval ( $ fromBase ) != 10 ) { $ len = strlen ( $ str ) ; $ q = 0 ; for ( $ i = 0 ; $ i < $ len ; $ i ++ ) { $ r = base_convert ( $ str [ $ i ] , $ fromBase , 10 ) ; $ q = bcadd ( bcmul ( $ q , $ fromBase ) , $ r ) ; } } else { $ q = $ str ; } if ( intval ( $ toBase ) != 10 ) { $ s = '' ; while ( bccomp ( $ q , '0' , 0 ) > 0 ) { $ r = intval ( bcmod ( $ q , $ toBase ) ) ; $ s = base_convert ( $ r , 10 , $ toBase ) . $ s ; $ q = bcdiv ( $ q , $ toBase , 0 ) ; } } else { $ s = $ q ; } return $ s ; }
docstring: Convert Long base
  
  @param mixed   $long     IP Long
  @param integer $fromBase Input base
  @param integer $toBase   Output base
  
  @return string
docstring_tokens: Convert Long base