webview-bundle
Webview Bundle Format (.wvb)
Header
- Magic Number (8 bytes)
- Big endian format. Value :
0xf09f8c90 / 0xf09f8e81
- Represents "🌐🎁" as utf8 encoding.
- Version (1 bytes)
- Version field for this webview bundle format.
- Available versions:
- Index Size (4 bytes)
- 4 bytes unsigned big endian value (
u32)
- Indicates the size of the Index field to be read next.
- Header checksum (4 bytes)
- Checksum verifies that the full header data has been decoded correctly.
- The checksum is the result of xxHash-32 algorithm digesting the header data as input.
Index
- Index
- This field has dynamic bytes size which is determined by the value of the Index Size field, and value is a big endian format.
- Format of index should be
HashMap formatted with binary encoded:
- Key is a path for this file.
- Value contains offset, length for reading contents from the data field.
- Value can contain http headers which will be included in the response.
- Index checksum (4 bytes)
- Checksum verifies that the full index data has been decoded correctly.
- The checksum is the result of xxHash-32 algorithm digesting the encoded index data as input.
Data
- Data
- This field has dynamic bytes size which can be determined each file offset and length from Index.
- The content of data is compressed with lz4 block format.
- The last 4 bytes are the checksum which is the result of xxHash-32 algorithm digesting the compressed data as input.