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 : CA - 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:
random.randint(0xfff000, 0xffffff)
I got the range limits from JSON, as a string.
{"range": "0xfff000,0xffffff"}
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 xThe 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.
$serial->sendMessage("\x02\x06\xf1");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?
Please note that by viewing our site you agree to our use of cookies (see Privacy for details). You will only see this message once.