The basic principle of file compression is to find the duplicate bytes in the file and create a dictionary file with the same bytes, which is represented by a code. For example, there are several identical words in the file, which are represented by a code and written into the dictionary file, so as to achieve the purpose of reducing the file.
Brief introduction of compression mechanism
Repetition is the repetition of a single byte. There are only 256 possible values in a byte, so this repetition is inevitable. Some bytes may occur more frequently, while others are often unevenly distributed statistically. This is easy to understand. Some symbols may be rarely used, while letters and numbers are used more frequently. Each letter appears at a different frequency. Compression mechanism is a very convenient invention, especially for network users, because it can reduce the total number of bits and bytes in the file, so that the file can be transmitted faster through a slow Internet connection. In addition, it can reduce the number of files.