2021-05-28 06:00 AM
I am using STM32CUBEIDE and want to convert each character of string to Hex string in STM32F4 Discovery Board, as I want to mask my string and process masked data. Please help me asap.
Solved! Go to Solution.
2021-05-30 10:50 AM
Most likely the author doesn't need any HEX conversion at all. It was already explained to him that HEX is just a typical text representation of binary data:
The "masking", which he is incapable of even explaining, seems to be this one:
https://datatracker.ietf.org/doc/html/rfc6455#section-5.3
A trivial algorithm with MOD and XOR operations. An ideal minor task for an absolute beginners like the author. One must learn the basics before making complex systems.
2021-05-28 06:51 AM
sprintf %x
2021-05-28 08:00 AM
but I want to store in variable not to print...
2021-05-28 08:44 AM
Description
The C library function int sprintf(char *str, const char *format, ...) sends formatted output to a string pointed to, by str.
Declaration
Following is the declaration for sprintf() function.
int sprintf(char *str, const char *format, ...)
Parameters
2021-05-28 09:26 AM
You're not explaining this very well, and the problem sounds like a C 101 level task.
Mask? As in hide/obfuscate?
2021-05-28 11:37 AM
yes and string should be masked i.e for websocket
2021-05-29 12:48 AM
Please provide me the answer like I just need to convert the Json string message to Hex code and after that, I need to mask as well. for Websocket Client application (RFC6455).
2021-05-30 07:37 AM
2021-05-30 10:50 AM
Most likely the author doesn't need any HEX conversion at all. It was already explained to him that HEX is just a typical text representation of binary data:
The "masking", which he is incapable of even explaining, seems to be this one:
https://datatracker.ietf.org/doc/html/rfc6455#section-5.3
A trivial algorithm with MOD and XOR operations. An ideal minor task for an absolute beginners like the author. One must learn the basics before making complex systems.
2021-05-31 05:34 AM
thanks Sir, means a lot...