From a5a9b737ae0dcf9b60c1851f5e59935562480212 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Fri, 7 Oct 2022 11:40:54 +0800 Subject: [PATCH] Update spec.md --- spec/v3/spec.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec/v3/spec.md b/spec/v3/spec.md index cae592d8..ee0a4a7 100644 --- a/spec/v3/spec.md +++ b/spec/v3/spec.md @@ -25,14 +25,15 @@ A Directory is a list of `Entries`, in ascending order by `TileId`: # Directory Serialization Entries are stored in memory as integers, but serialized to disk using these compression steps: - 1. A little-endian varint indicating the # of entries. - 2. Delta encoding of `TileId` - 3. Zeroing of `Offset`: - * `0` if it is equal to the `Offset` + `Length` of the previous entry - * `Offset+1` otherwise - 4. Varint encoding of ll numbers - 5. Columnar ordering: all `TileId`s, all `RunLength`s, all `Length`s, then all `Offset`s - 6. Finally, general purpose compression as described by the `Header`'s `InternalCompression` field. + +1. A little-endian varint indicating the # of entries +2. Delta encoding of `TileId` +3. Zeroing of `Offset`: + * `0` if it is equal to the `Offset` + `Length` of the previous entry + * `Offset+1` otherwise +4. Varint encoding of all numbers +5. Columnar ordering: all `TileId`s, all `RunLength`s, all `Length`s, then all `Offset`s +6. Finally, general purpose compression as described by the `Header`'s `InternalCompression` field # Directory Hierarchy