getid3_lib::BigEndian2String()
{} It's a method of the class: getid3_lib{}
No Hooks.
Return
String
.
Usage
$result = getid3_lib::BigEndian2String( $number, $minbytes, $synchsafe, $signed );
- $number(int) (required)
- -
- $minbytes(int)
- -
Default: 1 - $synchsafe(true|false)
- -
Default: false - $signed(true|false)
- -
Default: false
Code of getid3_lib::BigEndian2String() getid3 lib::BigEndian2String WP 6.0
public static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) { if ($number < 0) { throw new Exception('ERROR: self::BigEndian2String() does not support negative numbers'); } $maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF); $intstring = ''; if ($signed) { if ($minbytes > PHP_INT_SIZE) { throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits in self::BigEndian2String()'); } $number = $number & (0x80 << (8 * ($minbytes - 1))); } while ($number != 0) { $quotient = ($number / ($maskbyte + 1)); $intstring = chr(ceil(($quotient - floor($quotient)) * $maskbyte)).$intstring; $number = floor($quotient); } return str_pad($intstring, $minbytes, "\x00", STR_PAD_LEFT); }