Convert letters to hex
marcla
Posts: 19
Hello!
I have a question about convert letters to hex.
example.
string text contains "AAABBB"
and then i wont string hextext to contain "414141424242"
41 for A (ascii in hex)
42 for B (ascii in hex)
How do i do that?
Martin
I have a question about convert letters to hex.
example.
string text contains "AAABBB"
and then i wont string hextext to contain "414141424242"
41 for A (ascii in hex)
42 for B (ascii in hex)
How do i do that?
Martin
Comments
It's already in that form. Just look at the memory dump.
So,
You have to get every byte and convert it to the appropriate two digit equivalent, but you knew that.
In Spin, I do not know, there is no String handling... but... if you use a pointer to a byte array, that will/may work:
mystr : is your string...
myhex: is your hex result
Other better and more optimized versions could exist
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.