Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

future: more enums #4

@zander

Description

@zander

In the doc you write:

While this limits the count of state identifiers to 255, the byte 0xff can be reserved to indicate longer identifiers (as in UTF-8).

I like the spirit of this design but I need to point out that variable-byte-size encodings (like UTF8) work slighly different than you state.

The flag is the high-bit, not the value 0xff. Specifically the high bit indicates "there is another byte after this one".

Internally Bitcoin Core (and its derivatives) already use a variable byte width encoding that is different from the varint stuff and it might be useful to follow that design.

The main take-away here is that the line I quoted above would be corrected with something like:

While this limits the count of state identifiers to 255, the top bit can be reserved to indicate longer identifiers (as in UTF-8). This limits our current set of values to 127 until this encoding has been formalized

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions