Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $max = 4294967295;
- function dhex($val){
- global $max;
- $rest = $val;
- $string = "";
- while (true) {
- if ($rest > $max) {
- $quotient = $rest/$max;
- $int = floor($quotient);
- $num = $quotient-$int;
- $rest = $int;
- $string = dechex($num) . $string;
- } else {
- $string = dechex($rest) . $string;
- break;
- }
- }
- return $string;
- }
- echo dhex(979797565656);
Advertisement
Add Comment
Please, Sign In to add comment