pub mod detect;
pub mod files;
pub mod header;
pub mod parser;
pub mod reader;
pub mod streams;
pub const SIGNATURE: &[u8; 6] = &[0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C];
pub const SIGNATURE_HEADER_SIZE: u64 = 32;
pub const VERSION_MAJOR: u8 = 0;
pub const VERSION_MINOR: u8 = 4;
pub mod property_id {
pub const END: u8 = 0x00;
pub const HEADER: u8 = 0x01;
pub const ARCHIVE_PROPERTIES: u8 = 0x02;
pub const ADDITIONAL_STREAMS_INFO: u8 = 0x03;
pub const MAIN_STREAMS_INFO: u8 = 0x04;
pub const FILES_INFO: u8 = 0x05;
pub const PACK_INFO: u8 = 0x06;
pub const UNPACK_INFO: u8 = 0x07;
pub const SUBSTREAMS_INFO: u8 = 0x08;
pub const SIZE: u8 = 0x09;
pub const CRC: u8 = 0x0A;
pub const FOLDER: u8 = 0x0B;
pub const CODERS_UNPACK_SIZE: u8 = 0x0C;
pub const NUM_UNPACK_STREAM: u8 = 0x0D;
pub const EMPTY_STREAM: u8 = 0x0E;
pub const EMPTY_FILE: u8 = 0x0F;
pub const ANTI: u8 = 0x10;
pub const NAME: u8 = 0x11;
pub const CTIME: u8 = 0x12;
pub const ATIME: u8 = 0x13;
pub const MTIME: u8 = 0x14;
pub const WIN_ATTRIBUTES: u8 = 0x15;
pub const COMMENT: u8 = 0x16;
pub const ENCODED_HEADER: u8 = 0x17;
pub const START_POS: u8 = 0x18;
pub const DUMMY: u8 = 0x19;
}
pub mod attributes {
pub const READONLY: u32 = 0x01;
pub const HIDDEN: u32 = 0x02;
pub const SYSTEM: u32 = 0x04;
pub const DIRECTORY: u32 = 0x10;
pub const ARCHIVE: u32 = 0x20;
pub const REPARSE_POINT: u32 = 0x400;
pub const COMPRESSED: u32 = 0x800;
pub const UNIX_EXTENSION: u32 = 0x8000;
}
pub mod method_id {
pub const COPY: u64 = 0x00;
pub const DELTA: u64 = 0x03;
pub const BCJ: u64 = 0x04_01_00;
pub const BCJ2: u64 = 0x04_01_02;
pub const PPC: u64 = 0x04_02_05;
pub const IA64: u64 = 0x04_03_01;
pub const ARM: u64 = 0x04_04_01;
pub const ARMT: u64 = 0x04_05_01;
pub const SPARC: u64 = 0x04_06_05;
pub const ARM64: u64 = 0x04_09_01;
pub const DEFLATE: u64 = 0x04_01_08;
pub const DEFLATE64: u64 = 0x04_01_09;
pub const BZIP2: u64 = 0x04_02_02;
pub const LZMA: u64 = 0x03_01_01;
pub const LZMA2: u64 = 0x21;
pub const PPMD: u64 = 0x03_04_01;
pub const AES_256_SHA_256: u64 = 0x06_F1_07_01;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_signature() {
assert_eq!(SIGNATURE.len(), 6);
assert_eq!(SIGNATURE[0], b'7');
assert_eq!(SIGNATURE[1], b'z');
}
#[test]
fn test_signature_header_size() {
assert_eq!(SIGNATURE_HEADER_SIZE, 32);
}
#[test]
fn test_property_ids() {
assert_eq!(property_id::END, 0x00);
assert_eq!(property_id::HEADER, 0x01);
assert_eq!(property_id::MTIME, 0x14);
}
#[test]
fn test_method_ids() {
assert_eq!(method_id::COPY, 0x00);
assert_eq!(method_id::LZMA, 0x03_01_01);
assert_eq!(method_id::LZMA2, 0x21);
}
}