Generate a string of random characters

Here's a quick function for all those occasions when you need to generate a string of random characters in javascript.

Get string of random characters

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.

Generate random HEX color value

Ever needed to generate a random HEX color value? Here is a function for those rare times you might need it.

Generate a random GUID

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:
3F2504E0-4F89-11D3-9A0C-0305E82C3301

Showing 1 - 4 of 4 results