0

How can I decode a hex string to an ascii string? I want to find the meaning of

559EF4BE-D2E1-4009-AF7B-F81784946A89

or

81CB80D6-62C3-4BC8-99BE-31D7C6E739A4

Thanks

Abadis
  • 2,671
  • 5
  • 28
  • 42
  • What do you mean by "the meaning" of those? They look like GUIDs to me. You also haven't specified what language you're using, which makes it hard to answer... – Jon Skeet Jun 28 '12 at 06:37
  • Refer: http://stackoverflow.com/questions/9227246/hex-to-ascii-in-c for C and http://stackoverflow.com/questions/4785654/covert-a-string-of-hex-into-ascii-in-java for Java – Gaurav Agrawal Jun 28 '12 at 06:43

2 Answers2

1

This looks like a GUID which is just a complex id number. They did historically carry some information about the system they were created on but nowadays is just random.

Emil Vikström
  • 90,431
  • 16
  • 141
  • 175
  • Thanks for your answer.I didnt use any programing language to create these strings , but i need to use one to decode them.they are some words which have been changed to hex strings.I need the algorithm that changes them back to ascii mode. – Abadis Jun 28 '12 at 06:44
1

Just a small clarification: 'ASCII string' refers to the charset used to represent the characters, not whether or not these chars are represented as int, hex or as printable characters...

Anyways, what I assume you actually want is a program which will show the printable version of the characters. So here's one way to do it in python:

import re

pattern = "559EF4BE-D2E1-4009-AF7B-F81784946A89" #replace this with the hex string you want
hex_list = re.findall("[a-zA-Z0-9]{2}",pattern)
for h in hex_list:
    i = int(h,16)
    ascii_val = chr(i)
    print ascii_val,

Good luck.

BTW, hex strings as you presented them, are not usually meant to represent strings. Are you sure that's what you need?

dcoder
  • 12,651
  • 2
  • 20
  • 24