Zip-file that contains nothing but itself?

喜你入骨 提交于 2019-12-03 04:48:09

问题


Just out of curiosity, does there exist a valid zip-file (according to format spec) that, contains nothing but itself?

Put another way, does the function implemented by unzip have a fix-point?

Can I write a program to search for such a fix-point in a intelligent (not-exhaustive) way?

I've thought about the opposite as well, i.e. if zip has a fix-point, but presumably a file can be compressed in different ways (different algorithms, different levels of compression and so on), thus whether or not f = zip(f) holds for some file f is probably implementation dependent. Since the zip-compression is loss-less however, the case for unzip should probably have a "formal" answer.

Has anyone explored this? Any pointers to related URLs are appreciated.


回答1:


You can read about it here: http://research.swtch.com/2010/03/zip-files-all-way-down.html

Here you will find r.zip, which contains itself.



来源:https://stackoverflow.com/questions/3169246/zip-file-that-contains-nothing-but-itself

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!