Jump to content

Recommended Posts

Posted
What happens in Vegas, stays in Vegas :)

 

Although if you get married in Vegas - you are, in fact, married everywhere :p

 

 

Andy

Who said that?

Posted
If anyone wants the code i can attach it somewhere, would be easy to add to an intranet page etc... and any feedback/improvements welcome.QUOTE]

 

That would be very handy if you could do that tom, will come in very handy.

 

Maybe could add it to the wiki that was people on edugeek could improve it and make changes. or if you wish for it to be left that scrap that :D

 

Thanks

 

James.

 

Oh and glad to here gav's oki :p

Posted

Le Javascreept:

 

all you need now is an HTML form....

 

 

function password(len,hasnum)

{

// password(length,hasnum) length = password len, hasnum != 0 you get

// a number in there

var pass = "";

var digit = -1;

if (hasnum)

{

digit = Math.round((len-1)*Math.random());

}

 

var flip = true;

if (Math.random() > 0.7)

{

flip = false;

}

for(var i=0; i

{

var isdig = 0;

if (i == digit)

{

isdig = 1;

}

if (flip)

{

pass = pass + consonant(isdig);

}

else

{

pass = pass + vowel(isdig);

}

flip = !flip;

}

return pass;

}

 

function vowel(num)

{

var vow = [ 'a', 'e', 'i', 'o', 'u', 'y'];

if (num)

{

vow = ['0','3','4'];

}

var i = Math.round((vow.length-1)*Math.random());

return vow;

 

}

 

function consonant(num)

{

var con = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'];

if (num)

{

con = ['1','2','5','6','7','8','9'];

}

var i = Math.round((con.length-1)*Math.random());

return con;

 

}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...