| 1 | // Copyright (c) 2022 Harry [Majored] [[email protected]] |
| 2 | // MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE) |
| 3 | |
| 4 | pub const SIGNATURE_LENGTH: usize = 4; |
| 5 | |
| 6 | // Local file header constants |
| 7 | // |
| 8 | // https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#437 |
| 9 | pub const LFH_SIGNATURE: u32 = 0x4034b50; |
| 10 | #[allow(dead_code)] |
| 11 | pub const LFH_LENGTH: usize = 26; |
| 12 | |
| 13 | // Central directory header constants |
| 14 | // |
| 15 | // https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#4312 |
| 16 | pub const CDH_SIGNATURE: u32 = 0x2014b50; |
| 17 | #[allow(dead_code)] |
| 18 | pub const CDH_LENGTH: usize = 42; |
| 19 | |
| 20 | // End of central directory record constants |
| 21 | // |
| 22 | // https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#4316 |
| 23 | pub const EOCDR_SIGNATURE: u32 = 0x6054b50; |
| 24 | /// The minimum length of the EOCDR, excluding the signature. |
| 25 | pub const EOCDR_LENGTH: usize = 18; |
| 26 | |
| 27 | /// The signature for the zip64 end of central directory record. |
| 28 | /// Ref: https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#4314 |
| 29 | pub const ZIP64_EOCDR_SIGNATURE: u32 = 0x06064b50; |
| 30 | /// The signature for the zip64 end of central directory locator. |
| 31 | /// Ref: https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#4315 |
| 32 | pub const ZIP64_EOCDL_SIGNATURE: u32 = 0x07064b50; |
| 33 | /// The length of the ZIP64 EOCDL, including the signature. |
| 34 | /// The EOCDL has a fixed size, thankfully. |
| 35 | pub const ZIP64_EOCDL_LENGTH: u64 = 20; |
| 36 | |
| 37 | /// The contents of a header field when one must reference the zip64 version instead. |
| 38 | pub const NON_ZIP64_MAX_SIZE: u32 = 0xFFFFFFFF; |
| 39 | /// The maximum number of files or disks in a ZIP file before it requires ZIP64. |
| 40 | pub const NON_ZIP64_MAX_NUM_FILES: u16 = 0xFFFF; |
| 41 | |
| 42 | // https://github.com/Majored/rs-async-zip/blob/main/SPECIFICATION.md#439 |
| 43 | pub const DATA_DESCRIPTOR_SIGNATURE: u32 = 0x8074b50; |
| 44 | pub const DATA_DESCRIPTOR_LENGTH: usize = 12; |