只包含本身的ZIP文件? [英] Zip-file that contains nothing but itself?

查看:131
本文介绍了只包含本身的ZIP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是出于好奇,是否存在一个有效的zip文件(根据格式规范),只包含自己?



换句话说, unzip 实现的函数有一个固定点?



我可以编写一个程序来搜索这样一个fix-



我也想过相反的情况,也就是如果 zip 有一个固定点,但可能是一个文件可以以不同的方式(不同的算法,不同的压缩级别等等)压缩,因此无论 f = zip(f)保存为某些文件 f 可能是依赖于实现。因为zip压缩是无损的,然而, unzip 的情况应该有一个正式的答案。



<有没有人探讨这个?

解决方案

您可以在这里阅读: http://research.swtch.com/2010/03/zip-files-all-way- down.html



您可以在这里找到 r.zip ,其中包含它自己。


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.

解决方案

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.

这篇关于只包含本身的ZIP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆