web blazonry web development scripts and tutorials
 
Web blazonry.com
   Home       PHP       Name Generators       Perl       CSS       Javascript       Java       devTips       Resources   

Javascript Home


image scripts
  Image Load Order
  Mouse Overs
  SlideShow

JavaScript Resources
  Free JavaScript Books(new)
  Recommended Sites
  Bestselling Books





JavaScript: Password Generator

This is a handy little script that generates a password. It lets you set the number of characters you want for your password and whether punctuation is OK.

This is one of my personal favorite scripts because it is important to have a reasonably secure password. For more information, read my article about why it is important, and how to have a secure password.

Generated Password:

# of chars

No Punction Marks
Random Length (6 - 12)

 
 



This script works only in 4.0+ browsers. I cannot find a function in older JavaScript that can convert CHAR numbers to strings. Fortunately, this does not matter as much as it used to.


Here are a few of the key functions used in the code :

How I get my random number:

    // between 0 - 1
    var rndNum = Math.random()

    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;

How I convert random number to string:

    textChar = String.fromCharCode(rndNum);

Get the password generator source code.

 

Newest Pages
Free Linux Admin Books
Free Linux Books for Programmers
Free Books for Linux on the Desktop
Free PHP Books
Free JavaScript Books
Free Java Books - Advanced
Free Java Books - Basic
Free Perl Books
Free Python Books
Quote of the Day (PHP)
Debugging Part 2
How to Test Google Ads
Source Code for Test Google Ads (PHP)
Most Popular Pages
U.S. Name Generator
Wu Name Generator
Baby Name Generator
Upload and Resize an Image (PHP)
Popup Windows (JavaScript)
How To Install Apache + PHP + MySQL
Simple Web Calendar (PHP)

Least Popular Pages
Image Load-Order (Javascript)
dHTML: Scrolling Layers
iNews Aplet (Java)
ProcLog Search Your Logs (Perl)
 
 

  © 1997-2008. astonishinc.com   All Rights Reserved.