摘要 |
A method for compressing a data stream based on a combination of two digests is used. Each combination of digests that occurs multiple times is assigned a codeword. When the first digest matches, a data structure of second digests occurring with the same first digest is built, associating each combination of digests with a position in the stream where the combination of digests is found. When a new match is found a new codeword is defined. When a match with an existing codeword is found, a byte sequence is emitted that identifies the codeword associated with the matched data. When a partial match is found, the length of a codeword is changed and a corresponding byte sequence is emitted. The method finds particular application in data streams that are sent to printers, and which contain large blocks of identical data such as images or repetitive text. |