-
Notifications
You must be signed in to change notification settings - Fork 47
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
Rust: serde json encode VecM<u8> as base64 #118
Rust: serde json encode VecM<u8> as base64 #118
Comments
In the PRs I'm implementing this I've gone with hex instead of base64. While I prefer base64, and in most of our tools we appear to favor base64 for variable length binary data, in Soroban we use variable length binary fields frequently for conceptually fixed length fields. This means more often than not we have things like hashes or IDs in the vararray fields. I think we'll benefit by using hex since we often look at these types of data items in hex. It's also not much of a downside since it is just as trivial to encode and decode hex as it is base64 in most places. |
What
Change the serde json encoding of
VecM<u8>
as base64 in the Rust generated code.Why
It is common to transmit binary as base64 in JSON and most JSON tooling has good support for dealing with it in this format. e.g.
jq
.Follow up to #112 #117
The text was updated successfully, but these errors were encountered: