It depends on your goals. The GUID is easy to create, but it is a pain if the user must enter it manually. This is great if activation occurs, for example, by clicking on the URL provided by email, or if you can expect the user to copy and paste the value from the activation email.
In other cases (for example, compressed software in which the activation code is physically printed on the packaging in some way), the user will manually enter the code. In this case, you'd better use a method similar to that used by Microsoft and Blizzard: generate code consisting of five groups of five random alphanumeric characters (skip the vowels if you want to eliminate the risk that the activation code will contain something something like 4SHIT), and check each code generated against the main list for duplicates. (Although I think that the chances of even a 100,000 sequence extracted from {1, 2, ... 34 ^ 26 - 1} containing a duplicate are pretty small. It's hard to say for sure, because the only way I know is to calculate he overwhelms the double.)
source share