web blazonry web development scripts and tutorials Samsung Galaxy S II Epic Touch 4G Android Phone (Sprint) Best Price!
   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 Punctuation Marks
Random Length (6 - 12)

 
 



Why is it important to have a strong password? Identity theft tips to stay safe by LifeLock.com clearly states that creating a strong password is one of the ways to deter your identity from getting stolen.

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 much anymore, but might impact some obscure browsers running on various devices.

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

Least Popular Pages
iNews Applet (Java)
Java Resources
Site Monitor (Perl)
PHP Resources
 
 

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