0) { $return = chr(bcmod($operand, 256)) . $return; $operand = bcdiv($operand, 256); } if (ord($return[0]) > 127) { $return = "\0" . $return; } return $return; } /**public function integerToBinary($operand) { $return = ''; while(bccomp($operand, '0')) { $return .= chr(bcmod($operand, '256')); $operand = bcdiv($operand, '256'); } return $return; }**/ // Prior version for referenced offset public function hexToDecimal($operand) { $return = '0'; while(strlen($hex)) { $hex = hexdec(substr($operand, 0, 4)); $dec = bcadd(bcmul($return, 65536), $hex); $operand = substr($operand, 4); } return $return; } }