I have a program that reads in hex strings, and returns text based on the parameters of the string. A hex string goes as follows:
A : B : C
A - Length of B
B - Name of interface
C - Unimportant
so for example;
0465746830010000 = 04 : 65746830 : 010000 =4 : eth0 : __________
Now, I want to process the hex strings so that if there is a character that isn't in the alphabet, 0-9, or '-' , it lets me know somehow.
Such as here :
026601000002 : 6601 : _______2 : f[unreadable] : _______
Any ideas on how would I process this so that it lets me know if any of the characters outside of these parameters arise?
I'm trying to get random hex value between range of hexes:
I got the range limits from JSON, as a string.
How can I convert these strings(after splitting) to hexadecimal values?
This question already has an answer here:
I have code as below:
x = readsomevalue();print x
The printed value is an integer. I want this to be printed in hexadecimal. Any standard methods to do that?
I use the php_serial.class.php and have one question. When I send this below line to my device everything runs fine.
But when I do this way, nothing happens.
$str = "\x02\x06\xf1";$serial->sendMessage($str);
Anybody has any idea as why this is happening?
I'm trying to read hex values from a binary file. I don't have a problem with extracting a string and converting letters to hex values, but how can I do that with control characters and other non-printable characters? Is there a way of reading the string directly in hex values without the need of converting it?