mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
New packets, general Improvement
This commit is contained in:
@ -131,6 +131,17 @@ class Utils{
|
||||
|
||||
return ($negative === true ? "-":"").str_replace("x", "", $hash);
|
||||
}
|
||||
|
||||
public static function hexdump($bin){
|
||||
$output = "";
|
||||
$bin = str_split($bin, 16);
|
||||
foreach($bin as $counter => $line){
|
||||
$hex = chunk_split(chunk_split(str_pad(bin2hex($line), 32, " ", STR_PAD_RIGHT), 2, " "), 24, " ");
|
||||
$ascii = preg_replace('#([^\x20-\x7E])#', '.', $line);
|
||||
$output .= str_pad(dechex($counter << 4), 4, "0", STR_PAD_LEFT). " " . $hex . " " . $ascii . PHP_EOL;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
public static function microtime(){
|
||||
return microtime(true);
|
||||
|
Reference in New Issue
Block a user