>> 8) ^ CRC_TABLE[(oldCrc ^ charAt) & 0xff]) * * @param int $oldCrc * @param int $charAt * @return int|string */ public static function crc32($oldCrc, $charAt) { return MathHelper::castToInt(MathHelper::bitwiseXor(MathHelper::unsignedRightShift32($oldCrc, 8), self::$CRC_TABLE[MathHelper::bitwiseAnd(MathHelper::bitwiseXor($oldCrc, $charAt), 0xff)])); } public static function decryptByte($byte) { $temp = $byte | 2; return MathHelper::unsignedRightShift32($temp * ($temp ^ 1), 8); } public static function humanSize($size, $unit = "") { if ((!$unit && $size >= 1 << 30) || $unit == "GB") return number_format($size / (1 << 30), 2) . "GB"; if ((!$unit && $size >= 1 << 20) || $unit == "MB") return number_format($size / (1 << 20), 2) . "MB"; if ((!$unit && $size >= 1 << 10) || $unit == "KB") return number_format($size / (1 << 10), 2) . "KB"; return number_format($size) . " bytes"; } }