You Are Here: Home » Tutorials » Flash CS3 » Mix » Generatore di password Actionscript 3.0

Generatore di password Actionscript 3.0

Se avete bisogno di generare delle password sicure con Actionscript, ecco una funzione molto utile:

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;
}

About The Author

Flepstudio è una grande community di sviluppatori, tutorials e materiale per studiare, sbagliare, creare e crescere insieme... Flepstudio!

Number of Entries : 470

Leave a Comment

Scroll to top