Binary to ASCII
How do I convert the data received from queue(lvq) to ASCII or human readable format?
Comments
-
What is the binary format? If the payload is encoded with something like Google Protobufs or Avro, you'll need to deserialize it with the correct format.
If you just want to dump the binary contents to the console, I would suggest using SdkPerf, it is probably the most common/useful Solace utility. You can find it here: https://solace.com/downloads/ (tick the box "Other" to find it.
There are LOTS of parameters to use with it, but just to dump a message contents to the console, it will look something like:
sdkperf_lang -cip=<HOST> -cu=<USER>@<VPN> -cp=<PASSWODRD> -sql=<QUEUE_NAME> -qb -md e.g. ./sdkperf_java.sh -cip=localhost -cu=aaron@default -cp=pw -sql=q1 -qb -md
0 -
@Aaron @marc
I am dumping the message contents on the console itself & the binary format is like this —
00 00 47 4c aa 21 da 99 21 61 13 84 c3 29 64 5f ..GL.!.. !a...)d_
79 12 43 4b b7 00 00 53 54 6f 00 00 58 02 00 00 y.CK...S To..X...
this is not exact binary it contains hex decimals values as well. How do I change it to ASCII ?
e.g - -./Browser.c -cip=<HOST> -cu=<USER>@<VPN> -cp=<PASSWODRD> -sql=<QUEUE_NAME0 -
@Aaron @marc
After trying the command with C, the output still remains the same as binary & hex decimal.
The cmd I used —
/sdkperf_c -cip=<host> -cu=<username>@<vpn> -cp=<password> -sql=<queue> -qb -md
The output I got —
60 50 5b 5f 79 12 43 be 88 00 00 53 18 fc ff ffP[_y.C. ...S....
P
77 01 00 00 47 9e fa d4 b7 e1 6d 61 13 34 60 50 w...G... ..ma.4
how do I change it to human readable format?Please help me with this
0 -
That is ASCII, on the right. Hex codes on left, ASCII equivalent on the right. Anything that's a valid/printable ASCII char will show up, otherwise SdkPerf substitutes a period
.
char. That's why you can see the characters P, y, C, S, w, etc… but there are periods for everything else as they are either 0x00, 0x01, or out of range (e.g. > 0x7f).There's nothing more to see here, you're going to need to know the payload format to know how to deserialize this binary payload correctly.
0