Posts tagged ‘Security’

Generate passwords with JavaScript

The function generatePassword() is a simple yet customizable function that generates a random password string, the default password length is 6, you can override it by calling the function like thisĀ  generatePassword(n) where n is the password length. The possible characters are defined within the function with the variable chars

function generatePassword(len){
len = parseInt(len);
if(!len)
len = 6;
var password [...]