Skip to content

Only some enum values are interpreted as bytes, and not string, in custom JsonConverter. #94223

Answered by bartonjs
Danielovich asked this question in General
Discussion options

You must be logged in to vote

True base64 (vs base64url) always requires a multiple of 4 characters; so "John" is valid, "Johns" is not. Both base64s only have 64 valid characters, and neither of them considers ¡ a valid character, so "¡¡¡¡" is another example of an invalid base64 string.

In the grand universe of all possible strings, the "invalid base64" strings vastly outnumber the "valid base64" strings.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Danielovich
Comment options

@bartonjs
Comment options

Answer selected by eiriktsarpalis
@Danielovich
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Answer questions and provide assistance, not an issue with source code or documentation. area-System.Text.Json
3 participants
Converted from issue

This discussion was converted from issue #94206 on October 31, 2023 16:08.