zigzagDecode
The inverse of zigzagEncode: maps an unsigned 64-bit zigzag value back to the signed integer.
Available since v3.1.8
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | bigint | An unsigned integer in the 64-bit range |
Returns
Section titled “Returns”bigint — The signed integer
Examples
Section titled “Examples”Recover the signed value
Section titled “Recover the signed value”The inverse of zigzagEncode.
Decode a varint payload
Section titled “Decode a varint payload”Read the unsigned varint first, then undo the zigzag mapping.
