There are times when you need to get a string of random characters of the specified length. It could be the default password for a new account or a unique identifier for something (you would probably be better off generating a guid) in your database.
Here is a function for those occasions. It generates a string of the specified length consisting of random characters. You can choose which type of characters to include - lowercase, uppercase, numeric or special.
Ever needed to generate a random HEX color value? Here is a function for those rare times you might need it.
Function generateGuid creates a random GUID (globally unique identifier).
MSDN defines GUID as "a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated."
GUID consists of alphanumeric characters only and is grouped in five groups separated by hyphens as seen in this example: