Password generator Actionscript 3.0

Posted in Flash by Flash CS3 and Flash CS4 tutorials on the 03-22-2011

If you need to generate secure passwords with Actionscript, here is a useful function:

private function createPassword(length:Number=10):String
{
    var chars:String="abchefghjkmnpqrstuvwxyzQWERTYUIOPLKJHGFDSAZXCVBNM0123456789";
    var i:Number=0;
    var pass:String="";
    var nLenght:Number=chars.length;
    while(i<=length)
    {
        var num:Number=Math.round(Math.random()*nLenght);
        pass+=chars.charAt(num);
        i++;
    }
    return pass;
}
Read full article

  1. Responses to “Password generator Actionscript 3.0”

Post a Comment

captcha