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

Ensure we're never overlong #2

Open
klnusbaum opened this issue Jan 3, 2023 · 0 comments
Open

Ensure we're never overlong #2

klnusbaum opened this issue Jan 3, 2023 · 0 comments

Comments

@klnusbaum
Copy link
Owner

From @Cwillmore on discord

This is neat! one thing you should be aware of is that it's illegal for a utf8 string to encode a unicode codepoint in more bytes than the least possible. for example it's only legal to encode character 0x41 = 0b01000001 'A' as 01000001 (and not 11000001 10000001). in utf8 land this is called an "overlong form"
https://kevinboone.me/overlong.html?i=1
i think it's possible for your cipher to end up emitting an overlong form, e.g. if you encode two \0 chars in a row

Let's write some tests to ensure we're never overlong

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