7 ms·
jsonrpc “args” can vary in name, number, and type.
by sneak 7y ago
jsonrpc “args” can vary in name, number, and type.
- boomlinde 7y agoSure, but where you're doing {"msg": "eyJhIjogMTAsICJjIjogInRlc3RpbmciLCAiYiI6ICJoZWxsbyJ9", "h": "..."} you can as well be doing {"msg": "{\"a\": 10, \"c\": \"testing\", \"b\": \"hello\"}", "h": "..."} and skip base64 altogether. If you mean this as a point against the second part of my post, it's of course only in some limited circumstances you can simply dump the values in a defined order and be done with it. To make it general, you have to have delimiters for at least arrays, objects and numbers, canonicalize number representations, and probably output the keys as well, at which point you've invented your own complete serialization protocol.