Yngvarr

Generation

generate functionSat, 07 Jan 2023

gzencode and stream http archive

function stream_gzencode($input) { $size = strlen($input); $crc = crc32($input); $gzdata = "\x1f\x8b\x08\x00\x00\x00\x00\x00".substr(gzcompress($input, 9), 0, -4).pack('V', $crc).pack('V', $size); header('Content-Encoding: gzip'); header('Content-Length: '.strlen($gzdata)); header('Content-type: application/x-gzip'); die($gzdata); }

Questions about programming?Chat with your personal AI assistant