Link to home
Start Free TrialLog in
Avatar of ricardogsanchez
ricardogsanchezFlag for United States of America

asked on

String to Hex for UDP packet

Guys im a total newb to ruby and i have been battling with something
that should be very simple, help!

the situation is this: i need to feed a program via user input an int or
worst case a hex string...

eg: Please enter last octect of IP address: user enters:123 or 7B

i then want to include that as a hex byte in a UDP packet and send it.

Eg: UDP = "/x00/x12/x23/(insert value in hex here)/x00/x00"

I managed to include the value in there but the resulting UDP packet is
sending the value in asccii,
the packet looks like: 00:12:23:31:32:33:00:00

i have tried a bunch of variations and nothing..

any help is appreciated.
ASKER CERTIFIED SOLUTION
Avatar of ricardogsanchez
ricardogsanchez
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial