JSON BinPack 0.0.1
A space-efficient open-source binary JSON serialization format based on JSON Schema with both schema-driven and schema-less support.
 
Loading...
Searching...
No Matches
sourcemeta::jsonbinpack::ROOF_MULTIPLE_MIRROR_ENUM_VARINT Struct Reference

The encoding consists of the floor of maximum divided by the multiplier, minus the integer value divided by the multiplier, encoded as a Base-128 64-bit Little Endian variable-length unsigned integer. More...

Public Attributes

std::int64_t maximum
 The inclusive maximum value.
 
std::uint64_t multiplier
 The multiplier value.
 

Detailed Description

The encoding consists of the floor of maximum divided by the multiplier, minus the integer value divided by the multiplier, encoded as a Base-128 64-bit Little Endian variable-length unsigned integer.

Options

Option Type Description
maximum int The inclusive maximum value
multiplier uint The multiplier value

Conditions

Condition Description
value <= maximum The input value must be less than or equal to the maximum
value % multiplier == 0 The input value must be divisible by the multiplier

Examples

Given the input value 5, where the maximum is 16 and the multiplier is 5, the encoding results in the Base-128 64-bit Little Endian variable-length unsigned integer 2:

+------+
| 0x02 |
+------+