June 24, 2004

gzip file header

RFC 1952

把一個 gzip file 前 10 bytes dump 下來

1f 8b 08 00 b8 8e ea 3f 00 03
+---+---+---+---+---+---+---+---+---+---+
|ID1|ID2|CM |FLG| MTIME |XFL|OS |
+---+---+---+---+---+---+---+---+---+---+

ID1 ID2 固定是 1f 8b, 作為 gzip format 的識別
CM 是壓縮方式, 需填 08
FLG 是一些參數的 flag, 一般為 0, bit 5-7 reserved (Reserved FLG bits must be zero.)
MTIME 是最後異動時間, 單位秒, 相當於 date +%s
XFL 是其他參數, 一般為 0
OS = 03 = Unix

Posted by pank at June 24, 2004 10:19 PM
Comments
Post a comment













Remember personal info?