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

fix: use byte length for strings #92

Merged
merged 2 commits into from
Jul 5, 2024
Merged

fix: use byte length for strings #92

merged 2 commits into from
Jul 5, 2024

Conversation

divarvel
Copy link
Collaborator

@divarvel divarvel commented Jul 5, 2024

The spec has been clarified on how string length should be evaluated, see biscuit-auth/biscuit#159

tl;dr: string length is a minefield and no two languages do it consistently (and one could argue that no language does it properly).
Since cross-language compatibility is a core tenet of biscuit, let's do the thing that's guaranteed to work across languages: counting bytes in the utf8-encoded representation

The spec has been clarified on how string length should be evaluated, see biscuit-auth/biscuit#159

tl;dr: string length is a minefield and no two languages do it consistently (and one could argue that no language does it properly).
Since cross-language compatibility is a core tenet of biscuit, let's do the thing that's guaranteed to work across languages: counting bytes in the utf8-encoded representation
@divarvel divarvel merged commit 741dfa2 into main Jul 5, 2024
4 checks passed
@divarvel divarvel deleted the string-length-fix branch July 5, 2024 12:16
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

Successfully merging this pull request may close these issues.

2 participants