I am trying to create a basic licensing system where I take a unique ID from the client computer, and I get this Hexadecimal string (hyphens removed e.g. "84-18-CE-...."):


It's only encoded into this format to make the ID longer.

Basically what I've been trying to do (without success), is to create some routine that can transform this string into a 25-character long (minus the dashes) string like the one below:


(An alpha-numeric key with numbers or letters in no particular pattern, preferably letter,number, letter or vice versa)

I just can't figure out how I could then validate this key, so that I could extract the untransformed Hex string we began with.

  • Note that the original Hex string will not always be the same length. Also, a routine that will convert ANY string into such a format (alpha-numeric, caps-only) will be acceptable.
  • I just realized that perhaps this isn't possible (to shorten the string down to 25 characters, and still retain the information (silly, I know). I will now accept anything that will allow me to create a 25-character OR LONGER string, from which I can select 25 characters.

Convert the hexadecimal number to base 36. Example here.

According to that page, Your input yields


in base 36.

Here is a Stack Overflow question that has an arbitrary base conversion function in c# (alas, couldn't get the online converter to properly convert it to VB). You can see it in action here: http://ideone.com/nDun6s

  • Awesome! This is exactly the kind of thing I was looking for! Could you please include an example piece of code that would allow me to do this (or at least a namespace/class to look for)? – SolaGratia Jul 15 '14 at 15:47
  • C++ :S. Could you include a simple example in VB.NET? And is it possible to define the possible characters (map then out perhaps?) so I could exclude "O", like you were saying? – SolaGratia Jul 15 '14 at 15:51
  • It will take me a few minutes to knock something together. – Robert Harvey Jul 15 '14 at 15:52
  • I would really appreciate it :) – SolaGratia Jul 15 '14 at 15:53
  • Well, it's not VB.NET, but there you go. – Robert Harvey Jul 15 '14 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.