Actionscript PasswordUtil


Hi folks,

since so many people liked the CookieUtil, I will give away one of my other utils I have – a PasswordUtil. Many of you that are developing web applications with flex, or other actionscript 3 techniques, might have been in a situation where you needed to offer your users a solution to register up for a service. But what if you wanted to give your users the possibility to let you generate a password for them – solution is easy use PasswordUtil.

It allows you to generate random passwords in actionscript 3 of any length with just one single line of code. Just give a length and the chars that should be used. The class has predefined constants that you can use for the charset.

It comes with pre selected alphabets for the different chars you might want to use for your passwords, but you can extend it with any chars you like – change some lines and you can use it in russian or any other language.

Using it is easy:

var myPassword:String = PasswordUtil.generateRandomString( 32 , PasswordUtil.LETTERS);
trace(myPassword);

Just combine that with a button and a textinput field and voilá – there you go. The package contains a sample flex project that shows what you can do with it. It can also be used to generate a random integer of a specified length.

The scripts is public domain on a use it for whatever you like license, just like the CookieUtil.

http://depositfiles.com/files/yovo8uu4n

Advertisements
    • Masuma
    • March 3rd, 2009

    First blog I read after wakeup from sleep today!

    —————————-
    #1 Top Search Engine – Google

  1. Как там у вас с погодой? Давно не писали

    • I do not understand any russian, please post your question in english or I can not help you.

  2. Спасибо за статью оказалась очень полезной.

  3. Dah, i have my own class just the same, written about a year ago lol ^_^

  4. Пока прочитал только эту одну заметку, если и все остальное также интересно, то автору респект 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: