I’m trying to parse some strings in protobuf format using the @bitwalker’s exprotobuf, but I’m not sure how to do that. From the examples it seems like the library is designed to implement Elixir modules using .proto
files but all I want to do is get the contents of these protobuf strings in readable format.
I know this library should be able to decode the proto strings before converting them into modules, but there isn’t any documentation for that. I’m currently trying a few things with Protobuf.Decoder.decode/2
to see if that works for me.
Please help!
iex(33)> inspect proto_data
"<<10, 204, 30, 18, 201, 30, 26, 207, 2, 40, 176, 165, 174, 251, 156, 42, 48, 5, 74, 89, 103, 112, 58, 65, 79, 113, 112, 84, 79, 70, 120, 70, 107, 114, 103, 78, 89, 48, 122, 117, 111, 106, 71, 73, 115, 67, 113, 95, 111, 119, ...>>"
iex(34)> inspect proto_data, binaries: :as_strings
"\"\\n\\xCC\\x1E\\x12\\xC9\\x1E\\x1A\\xCF\\x02(\\xB0\\xA5\\xAE\\xFB\\x9C*0\\x05JYgp:AOqpTOFxFkrgNY0zuojGIsCq_ow2M-ve0gElq6xNzW7ijGBeT_9gotFOHArnkh3xrfIhamGIGjY956kSnkrFPg\\x8A\\x02\\xE7\\x01\\n\\x1Cperson-108247076822183591710\\x12\\x15108247076822183591710\\x18\\x1C \\t*\\x0FShahzaib NaseerRe\\b\\x04*\\\\ .... .... ....."