def zigzag(value: int) -> int:
    """Zig-zag encode a parameter to turn signed ints into unsigned ints.

    Zig-zag encoding is required by Geometry commands that require parameters,
    and the number of parameters will be (number_of_commands * number_of_arguments).
    For more information about this technique, check out:
    https://developers.google.com/protocol-buffers/docs/encoding#types

    Args:
        value: the integer value to encode

    Returns:
        The encoded representation of the value.

    """
    return (value << 1) ^ (value >> 31)