본문 바로가기

LZ77 알고리즘 LZ77 알고리즘 (LZ77 Encoding): LZ77알고리즘은 사전 방식 ( Dictionary methods )을 채택한다. 즉, 반복적으로 나오는 문자열을 압축한다. zip, gzip, pkzip 등에서 사용되는 압축 알고리즘이다.다른 알고리즘과 결합되어 deflate 방식 등으로 사용된다. Pseudo-Code 는 다음과 같다.1 begin2 fill view from input3 while (view not empty) do4 begin5 find longest prefix p of view starting in coded part6 i = position of p in window7 j = length of p8 x = first char after p in view9 output( i , ..
Deflate 알고리즘 Deflate 알고리즘: zip, gzip 등의 프로그램에서 압축방식으로 사용하는 알고리즘. Deflate 알고리즘은 LZ77 알고리즘과 허프만 부호화 알고리즘이 결합된 압축방식이다. 그림으로 설명하면 다음과 같다. 1. Data가 있다. 2. 먼저 LZ77알고리즘을 통해 압축하여 LLD블럭들이 나온다. 3. 이 LLD들을 가지고 허프만 부호화 알고리즘을 거친다. 4. deflate 압축 완료.
파이썬 Crc32 계산 [ 파이썬 Crc32 계산하기 (ZIP Archive) ] 파이썬 전 플랫폼 가능. binascii 모듈의 crc32() 함수를 이용하므로, import binascii 해주자. "ZIP 포맷의 Crc-32 계산을 위한 함수"로, 다른 경우에는 적합하지 않다.( Crc-32 with magic number 'debb20e3'(little endian) ) 1. 일반적 사용법import binascii crc =binascii.crc32(b"nightohl")print('crc32 = {:#010x}'.format(crc))==> crc32 = 0x4c2810b2 2. 2개 이상의 조각의 Crc-32 구하기import binasciicrc = binascii.crc32(b"night") crc = bina..