Protobuf Buffer binary data
Decoded value
Jeongho Nam - https://github.com/samchon
Protocol Buffer Decoder.
typia.protobuf.decode()
is a function decoding a binary data of Protocol Buffer
format to a TypeScript instance.
For reference, as Protocol Buffer handles binary data directly, there's no way
when input
binary data was not encoded from the T
typed value. In that case,
unexpected behavior or internal error would be occured. Therefore, I recommend you
to encode binary data of Protocol Buffer from type safe encode functions like below.
Use encode function only when you can ensure it.
Also, typia
is providing type safe decoders like assertDecode, but it
is just for additional type validation like number & Minimum<7>
or
string & Format<"uuid">
cases, that are represented by
custom tags. Thus, I repeat that,
you've to ensure the type safety when using decoder functions.
Protobuf Buffer binary data
Decoded value
Jeongho Nam - https://github.com/samchon
Protocol Buffer Decoder.
typia.protobuf.decode()
is a function decoding a binary data of Protocol Buffer format to a TypeScript instance.For reference, as Protocol Buffer handles binary data directly, there's no way when
input
binary data was not encoded from theT
typed value. In that case, unexpected behavior or internal error would be occured. Therefore, I recommend you to encode binary data of Protocol Buffer from type safe encode functions like below. Use encode function only when you can ensure it.Also,
typia
is providing type safe decoders like assertDecode, but it is just for additional type validation likenumber & Minimum<7>
orstring & Format<"uuid">
cases, that are represented by custom tags. Thus, I repeat that, you've to ensure the type safety when using decoder functions.