Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** Encode a signed long */ function encodeSignedLong( int $id ) : string { $hig..
Decoded Output download
<?php
/** Encode a signed long */
function encodeSignedLong( int $id ) : string {
$high = ( $id & 0xffffffff00000000 ) >> 32;
$low = $id & 0x00000000ffffffff;
return pack( 'NN', $high, $low );
}
/** Encode a signed long (float literals out of range) */
function encodeSignedLongInvalid( int $id ) : int {
$high = ( $id & 0xfffffffff00000000 ) >> 32;
$low = $id & 0x100000000ffffffff;
return ~0xff000f000f000f000 ^ $high ^ $low;
}
echo bin2hex(encodeSignedLong(0x7ffffff));
function misc899( int $id ) : int {
// these numbers can be precisely represented as floats without losing the least significant bit
return ( ~0xf0ffffff000ff000 ) ^ ( $id | 0xffffffff00000000 );
}
echo misc899(0x899);
?>
Did this file decode correctly?
Original Code
<?php
/** Encode a signed long */
function encodeSignedLong( int $id ) : string {
$high = ( $id & 0xffffffff00000000 ) >> 32;
$low = $id & 0x00000000ffffffff;
return pack( 'NN', $high, $low );
}
/** Encode a signed long (float literals out of range) */
function encodeSignedLongInvalid( int $id ) : int {
$high = ( $id & 0xfffffffff00000000 ) >> 32;
$low = $id & 0x100000000ffffffff;
return ~0xff000f000f000f000 ^ $high ^ $low;
}
echo bin2hex(encodeSignedLong(0x7ffffff));
function misc899( int $id ) : int {
// these numbers can be precisely represented as floats without losing the least significant bit
return ( ~0xf0ffffff000ff000 ) ^ ( $id | 0xffffffff00000000 );
}
echo misc899(0x899);
Function Calls
None |
Stats
MD5 | f01e065769d688e2962fe7a85265c27f |
Eval Count | 0 |
Decode Time | 85 ms |