How The Archiver Works

Table of contents:

How The Archiver Works
How The Archiver Works

Video: How The Archiver Works

Video: How The Archiver Works
Video: What are Archives? | Animating the Archives 2024, November
Anonim

Archivers are programs that can compress information in files. Modern archivers allow you to combine several files into one archive and view the contents of such archives. The size of the archive created with their help turns out to be much smaller than the size of the original file.

How the archiver works
How the archiver works

Instructions

Step 1

The general principle of operation of most archivers is based on an algorithm that was developed by researchers A. Lampel and J. Ziv in the 80s of the last century. The algorithm created by Ziv and Lampel allows you to calculate the code that is repeated in the file and thus reduce its size. For this, a dictionary is compiled from data sequences. For example, the binary code of the file contains the following combination: 10111011101110110011. It is easy to see that the code 1011 is repeated several times in it. The archiver detects such a code and writes it to the archive only once, and when unzipping it, it again substitutes the code in the necessary places in the file.

Step 2

How well the archiver will compress the file depends on the size of the source dictionary. If the dictionary is too large, it will affect the size of the archive. If the dictionary size is too small, errors may occur in the created archive. You can increase the compression ratio of a file using entropy coding (the so-called Huffman method). With entropy coding, repeating binary chunks are written using a shortcode. In modern archivers, entropy coding is used as an additional coding method.

Step 3

On Unix systems, gzip is the most popular archiver. This archiver compresses data losslessly and is based on the Deflate algorithm. Compression of files here occurs in two approaches - first, duplicate pieces of code are replaced, and then the characters in them are replaced with new characters using the Huffman method. Archivers for Unix systems have a number of disadvantages. They are primarily aimed at archives consisting of many files, so unzipping a single file is difficult. This is because Unix archivers view an archive as a continuous array of data of all files packed into it. The archive is formed on the basis of the information contained in each file.

Step 4

On Windows systems, such archivers as WinZip, 7-zip and WinRAR are common. Unlike Unix systems, these archivers are focused on working both with individual files and with continuous archives consisting of many files. Most modern Windows archivers "understand" many archive formats, support encryption and are capable of compressing very large files (for example, the maximum file size for the WinRAR archiver is more than eight billion gigabytes).

Recommended: