web blazonry web development scripts and tutorials
 
Web blazonry.com
   PHP       Name Generators       Perl       CSS       Javascript       Java       MySql       How Tos       Resources   

Javascript Home


image scripts
  Image Load Order
  Mouse Overs
  SlideShow

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

Bookmark and Share





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
Test Google Ads Ver. 2
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
Most Popular Pages
U.S. Name Generator
Baby Name Generator
Wu Name Generator
Popup Windows (JavaScript)
Intro to Web Databases (PHP, MySQL)
Upload and Resize an Image (PHP)
How To Install Apache + PHP + MySQL

Least Popular Pages
iNews Aplet (Java)
Java Resources)
Site Monitor (Perl)
Load Order of Images(Javascript)
 
 

  privacy policy     ||     © 1997-2010. astonishinc.com   All Rights Reserved.