aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/midx/MultiPackIndexConstants.java
blob: 5d86f44baf7161e4a60ba0e9123c893fe1d171db (plain)
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
/*
 * Copyright (C) 2025, Google LLC
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package org.eclipse.jgit.internal.storage.midx;

class MultiPackIndexConstants {
	static final int MIDX_SIGNATURE = 0x4d494458; /* MIDX */

	static final byte MIDX_VERSION = 1;

	/**
	 * We infer the length of object IDs (OIDs) from this value:
	 * 
	 * <pre>
	 * 1 => SHA-1
	 * 2 => SHA-256
	 * </pre>
	 */
	static final byte OID_HASH_VERSION = 1;

	static final int MULTIPACK_INDEX_FANOUT_SIZE = 4 * 256;

	/**
	 * First 4 bytes describe the chunk id. Value 0 is a terminating label.
	 * Other 8 bytes provide the byte-offset in current file for chunk to start.
	 */
	static final int CHUNK_LOOKUP_WIDTH = 12;

	/** "PNAM" chunk */
	static final int MIDX_CHUNKID_PACKNAMES = 0x504e414d;

	/** "OIDF" chunk */
	static final int MIDX_CHUNKID_OIDFANOUT = 0x4f494446;

	/** "OIDL" chunk */
	static final int MIDX_CHUNKID_OIDLOOKUP = 0x4f49444c;

	/** "OOFF" chunk */
	static final int MIDX_CHUNKID_OBJECTOFFSETS = 0x4f4f4646;

	/** "LOFF" chunk */
	static final int MIDX_CHUNKID_LARGEOFFSETS = 0x4c4f4646;

	/** "RIDX" chunk */
	static final int MIDX_CHUNKID_REVINDEX = 0x52494458;

	/** "BTMP" chunk */
	static final int MIDX_CHUNKID_BITMAPPEDPACKS = 0x42544D50;

	private MultiPackIndexConstants() {
	}
}