-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsts.php
More file actions
60 lines (50 loc) · 1.8 KB
/
Copy pathConsts.php
File metadata and controls
60 lines (50 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
declare(strict_types=1);
namespace Kduma\PCF;
/**
* On-disk constants defined by PCF v1.0.
*
* Every value here is normative and corresponds directly to a figure in the
* specification (see Appendix A, "Field Layout Summary").
*/
final class Consts
{
/** File signature, 8 bytes: 0x89 'K' 'P' 'R' 'T' 0x0D 0x0A 0x1A. */
public const MAGIC = "\x89KPRT\x0D\x0A\x1A";
/** Major format version implemented by this library. */
public const VERSION_MAJOR = 1;
/** Minor format version implemented by this library. */
public const VERSION_MINOR = 0;
/** Fixed size of the file header, in bytes. */
public const HEADER_SIZE = 20;
/** Fixed size of a table-block header, in bytes. */
public const TABLE_HEADER_SIZE = 74;
/** Fixed size of a single partition entry, in bytes. */
public const ENTRY_SIZE = 141;
/** Size of every hash field, in bytes (large enough for the widest digest). */
public const HASH_FIELD_SIZE = 64;
/** Size of the partition label field, in bytes. */
public const LABEL_SIZE = 32;
/** Size of the partition UID field, in bytes. */
public const UID_SIZE = 16;
/**
* Reserved partition type: invalid / uninitialised. MUST NOT label a live
* partition.
*/
public const TYPE_RESERVED = 0x0000_0000;
/**
* Reserved partition type: raw / blob, interpreted entirely by the
* application.
*/
public const TYPE_RAW = 0xFFFF_FFFF;
/** The NIL UID (all zero). MUST NOT label a live partition. */
public const NIL_UID = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
/**
* Maximum number of entries a single table block can hold (partition_count
* is a u8).
*/
public const MAX_ENTRIES_PER_BLOCK = 255;
private function __construct()
{
}
}