-
Notifications
You must be signed in to change notification settings - Fork 571
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
support decoding bytes as a hex string somehow #958
Comments
You could write a |
This is basically what the Gzip and Deflate wrappers are doing: on-the-fly transcoding. Hex is, thankfully, a much simpler encoding so it should be much simpler to do. |
So I guess where I was at was I didn't want to interfere with the bookeeping going on with ProtoReader (it keeps track of how many bytes etc). Are you saying you would make a proto-aware source that looks at encoded fields to figure out which ones are bytes and should become hex? |
I'm referring to this which I couldn't find a sensible way to work around without invalidating the reader (doing stream parsing) https://github.com/square/wire/blob/master/wire-runtime/src/jvmMain/kotlin/com/squareup/wire/ProtoReader.kt#L371 |
Oh so you want an individual field to do hex-to-byte conversion? Is it
represented as a string or as bytes in the encoded form?
…On Fri, May 10, 2019, 10:33 PM Adrian Cole ***@***.***> wrote:
I'm referring to this which I couldn't find a sensible way to work around
without invalidating the reader (doing stream parsing)
https://github.com/square/wire/blob/master/wire-runtime/src/jvmMain/kotlin/com/squareup/wire/ProtoReader.kt#L371
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#958 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAQIEKK5MLJWUFCB2N66KLPUYV53ANCNFSM4HMHDT3A>
.
|
yep. in proto it is bytes, in everywhere else (java type, correlation and json encoding) it is hex |
incidentally there's a slightly related problem in the same data type as IPs are in the proto as bytes, but everywhere else string literals. Ideally some callback to process the bytes one-by-one would be good, but at any rate having the hex thing for IDs improves a good measure. |
There's an undocumented concept called adapters which should be able to
solve this. Perhaps Jesse can chime in since he wrote it. Otherwise I'll
circle back soon.
…On Fri, May 10, 2019, 10:44 PM Adrian Cole ***@***.***> wrote:
incidentally there's a slightly related problem in the same data type as
IPs are in the proto as bytes, but everywhere else string literals. Ideally
some callback to process the bytes one-by-one would be good, but at any
rate having the hex thing for IDs improves a good measure.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#958 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAQIEPC23ZPZSOR3BH7MHLPUYXIHANCNFSM4HMHDT3A>
.
|
While edge case, Zipkin's primary representation of bytes is hex (even if they are transmitted in proto as raw bytes). It helps performance wise to be able to parse into a hex string (likely other way, too)
ex
The text was updated successfully, but these errors were encountered: