If I create two GUIDs then I understand they will be unique but is part of that dependent on the time. I would like to create a random string that is completely random.
Maybe if someone knows how a GUID is created that would help me to understand.
If I create two GUIDs then I understand they will be unique but is part of that dependent on the time. I would like to create a random string that is completely random.
Maybe if someone knows how a GUID is created that would help me to understand.
If I create GUIDs then is there a way I can check if one GUID is created after another?
No. There are lots of ways to make GUIDs. Nothing in the GUID encodes the time. It is possible that a poorly implemented GUID generator would encode the time of generation, but in general, given a GUID, you do not know the algorithm used to generate it.
I would like to create a random string that is completely random.
Use a good quality random number generator. Although be warned that its hard to find true random number generators on a general computer. Usually the best you can do is use a pseudo random number generator.
-- Wikipedia's answers this clearly --
GUIDs are usually stored as 128-bit values, and are commonly displayed as 32 hexadecimal digits with groups separated by hyphens, such as {21EC2020-3AEA-4069-A2DD-08002B30309D}. GUIDs generated from random numbers sometimes contain 6 fixed bits saying they are random and 122 random bits; the total number of unique such GUIDs is 2122 (approximately 5.3×1036). This number is so large that the probability of the same number being generated randomly twice is negligible; however other GUID versions have different uniqueness properties and probabilities, ranging from guaranteed uniqueness to likely non-uniqueness. Assuming uniform probability for simplicity, the probability of one duplicate would be about 50% if every person on earth as of 2014 owned 600 million GUIDs.
Here is the source for C# if you want a more intrinsic understanding: http://referencesource.microsoft.com/#mscorlib/system/guid.cs