-
Notifications
You must be signed in to change notification settings - Fork 11
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
Define string vs base32 vs base64 #20
Comments
What benefit does this have over storing Base64 encoded data in a string? |
@jordanbtucker it IS base64 in a string, just that we need some kind of "flag" or "header" to note is as such. |
Just a note: We are not even considering
since these are more niche formats for packing more data than base64 |
How would you implement this in an ES5 compatible way? |
@jordanbtucker perhaps instead of |
I still don't understand. Can you give a full example of a JSON5 document that uses your proposed feature? |
Here is an example in standard JSON with base64 encoding
Surly there could be a way for JSON5 to trim the fat and make base64 object wrappers "shorter"? |
Yes, there could be a way for JSON5 to make this shorter, but why? Why isn't your example good enough? |
Too many characters or too clunky (my first thought)? if I can design my syntax then |
This breaks ES5 compatibility. |
What would be the most lightweight yet compatible way of labeling a string as base64 or some other common encoding? |
You could encode the string like this:
Then use a recover function to parse it. |
|
JSON5 supports Hex in "0x" and "0X" forms, which is awesome: I wanted to confirm and explicitly state that JSON5 will never support base64 since it would break ES5 compatibility. (I would not be in favor, just double checking to make sure.) Thanks for all you do Jordan. |
Might be a good idea to have a YAML
!!str to !!binary
(binary as in base64) equivalent.Base64 should be standardized to be HTML and JSON safe, either RFC 4648 §5 (
- and _
) or, next best option, RFC 4648+ and /
(might cause issues with comments if there are double slash in the data).base32 should be either Crockford's, or second best, RFC 4648 (more confusable characters).
The text was updated successfully, but these errors were encountered: