Jump to content

Question about Zip files


MythicDawnAssassin

Recommended Posts

Allright; I'm following coputer science at university and I'm really wondering how a Zip file works.

You see there is this file called MyMod.esp which is 47 kb large. I put it in a Zip file called MyMod.zip and that's only 8 kb large! THAT'S IMPOSSIBLE right? at first I thought it was a serious bug in my system, but I havn't got any complains when I uploaded it, so it's allright. I'm still wondering though: HOW can a computer make a file smaller and still preserve all the content in it? Anyone know?

Link to comment
Share on other sites

The basic premise - data on your hard disk is a bunch of numbers. In order to compress it, a program like WinZip, 7Z, or any other turns the file into a long number and looks for repeating patterns in that number. So, for example, if there was the string "1035489452130" and it occured in the long number 50 times, it would substitute "1035489452130" with a Z. So you can see right away how Z is shorter than "1035489452130". Then multiply it by 50 as in our example and you can see how you can gain dramatically smaller files in some cases. This is also why if you try to put, say, an mp3 into a zip file, you will get almost no file size change. An mp3 is already compressed.

Then, when you decompress (unzip), it puts "1035489452130" back in in place of Z, giving you back your original data.

Obviously modern compression software takes this idea to extremes and does all kinds of tricks with it, but that is the basic concept.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...