venus/OBJECTS.md

49 lines
1.8 KiB
Markdown

# Object format
Objects are stored for each mod. Each object consists of a custom binary diff-style format(where numbers are little-endian unless otherwise noted):
```
0x0B7D1FF0: Magic number
0x00000001: 32-bit version. By convention, unofficial object formats should have the left-most(commonly referred to as the 31st bit) set.
0x0000000000000007: 64-bit number of entries
0x0000000067D9F179: 64-bit unix timestamp of the mod's creation in seconds
0x182E06194DB125D7: 64-bit unix timestamp(in nanoseconds) of the object's creation
0x0000000000000000: 64-bit unix timestamp(in nanoseconds) of the previous object's creation or 0 if no there is no previous object
0x000000000000000000000000000000000000000000000000: Padding
0xCF83E1357EEFB8BDF1542850D66D8007D620E4050B5715DC83F4A921D36CE9CE47D0D13C5D85F2B0FF8318D2877EEC2F63B931BD47417A81A538327AF927DA3E: SHA512 hash of object with hash replaced with this hash(the SHA512 hash of an empty string)
0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: Same as hash above but of previous object, or 0 if no previous object.
(entries)
```
Each entry is in the format:
```
0x0000000000000007: 64-bit size of path in bytes
0x0000000000000008: Number of diffs
0x00: Type of change: 0=Removal of file(no diffs), 1=Modification or addition
(path as a UTF-8 encoded string using UNIX conventions such as a forward slash / as a separator)
(diffs)
```
Each diff is in the format:
```
0x00: Type of change: 0=Removal(no body), 1=Insertion, 2=Replacement
0x00000000000000: Padding
0x0000000000000000: Start of change (relative to original file)
0x0000000000000010: Length of change
(body)
```
Known versions:
|32-bit value|Name|
|-----|-----|
|0x00000000|Version from before version 0.1|
|0x00000001|Official venus version 0.1(this doc)|