Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable length decoding #257

Open
NickStallman opened this issue Jun 21, 2024 · 0 comments
Open

Variable length decoding #257

NickStallman opened this issue Jun 21, 2024 · 0 comments

Comments

@NickStallman
Copy link

How would you go about decoding a variable length format, like just for example UTF-8?

It needs to:

  1. Read a single byte, if the values are between x and y then it's a single byte
  2. Else read a second byte and then treat it as a single 16 bit value
  3. This process could continue

My specific use case has a single byte command, except when that byte is 0xfe in which case it's a two byte command. It's a very rudimentary case where more than 256 commands were needed so they just created a 2nd list of 256 commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant