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.

Convert seconds to hours, minutes and seconds (JavaScript)

This is JavaScript implementation of the PHP function previously described in Convert seconds to hours, minutes and seconds (PHP). Please see the link for more detailed explanation of the function.

Convert size in bytes to human readable format (JavaScript)

This is JavaScript implementation of the function described in my earlier article Convert size in bytes to a human readable format (PHP). Please see the link for more in-depth explanation of the function workflow.

Functions for working with cookies in JavaScript

This article contains three main functions to work with document cookies in JavaScript. The functions that you will find here are: cookieGet, cookieSet and cookieDelete. As their names suggest, they will allow you to set, get and delete current document's cookie respectively.

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.

Showing 16 - 20 of 32 results