이것은 bzip2 archive format에 관한 질문입니다. 모든 Bzip2 아카이브는 파일 헤더, 하나 이상의 블록 및 테일 구조로 구성됩니다. 모든 블록은 "1AY & SY"로 시작해야하며 6 바이트의 BCD 인코딩 번호 Pi 값 0x314159265359로 시작해야합니다. the source of bzip2에 따르면Bzip2 블록 헤더 : 1AY & SY
/*--
A 6-byte block header, the value chosen arbitrarily
as 0x314159265359 :-). A 32 bit value does not really
give a strong enough guarantee that the value will not
appear by chance in the compressed datastream. Worst-case
probability of this event, for a 900k block, is about
2.0e-3 for 32 bits, 1.0e-5 for 40 bits and 4.0e-8 for 48 bits.
For a compressed file of size 100Gb -- about 100000 blocks --
only a 48-bit marker will do. NB: normal compression/
decompression do *not* rely on these statistical properties.
They are only important when trying to recover blocks from
damaged files.
--*/
질문이다 : 그것은 모두의 bzip2 아카이브 바이트 경계에 정렬 시작과 블록있을 것이라는 점을, 사실인가요? 나는 bzip2, bzip2-1.0.5 + 유틸리티의 참조 구현에 의해 생성 된 모든 아카이브를 의미합니다.
bzip2는 스트림을 바이트 스트림이 아닌 비트 스트림으로 해석 할 수 있다고 생각합니다. 블록 자체는 디자인에 의해 바이트 정렬되지 않은 허프만으로 인코딩됩니다.
즉, grep -c 1AY&SY
(블록에서 1AY & SY를 생성 할 수 있음)이거나 파일의 bzip2 블록 수와 같으면?
학교의 잔인한 종류입니까? – osgx
그 잔인하지, 아니 :) 그것은 방문 교수가 제공 한 데이터 압축 과정이었습니다. 이 사람 : http://webhome.cs.uvic.ca/~nigelh/ – Ryan
그래서 0x314159265359 및 블록을 찾기 위해 이동 된 상수의 모든 변형을 검색 할 수 있습니까? – osgx