2010-12-15 75 views
2

問候,我試圖分析zlib(gzip)算法與輸入相比較的輸出。確定字典大小,子字符串游程長度對以及它們在原始明文中的對應位置等內容。我使用zlib來交換許多非常小的數據塊(每個小於1K),並且想要確定字典中的開銷,結果中子字符串匹配的百分比與字典編碼的明文的比例,諸如此類。zlib/gzip解釋器

在Google的快速搜索沒有產生結果後,我在這裏問了一下,在開始使用調試消息給zlib源代碼播種以獲得類似結果之前。

是否有現成的東西存在這樣的東西?

+0

播種的zlib聽起來是個好主意。 – qdot 2010-12-15 16:14:03

+0

是的,一次性解決方案效果相當不錯。儘管在公共場合顯示修改,我會感到尷尬! – user17925 2011-02-10 21:54:50

回答

3

看看http://zlib.net/infgen.c.gz

從代碼中的註釋:

* Read a zlib, gzip, or raw deflate stream from stdin and write a defgen 
* compatible stream representing that input to stdout (though any specific 
* zlib or gzip header information will be lost). This is based on the puff.c 
* code to decompress deflate streams. Note that neither the zlib nor the gzip 
* trailer is checked against the uncompressed data (in fact the uncompressed 
* data is never generated) -- all that is checked is that the trailer is 
* present. 
+2

嗨@Mark,歡迎來到SO - 只是一個說明,它有助於簡要介紹您鏈接的內容,以便OP瞭解它是否解決了他們的問題,並打擊了鏈接腐敗。我已經提出了一些你的介紹性評論到這個答案,但隨時編輯來改善,這聽起來像這個鏈接將幫助OP非常:) – 2012-02-05 11:19:34