aodz

Password Strength monitor in flex

Posted on: October 10, 2008


Yesterday I spent hours writing my own password strength monitor utility in for a personal project but i couldn’t make it work properly, So i did exactly what every other developer does after getting thoroughly frustrated i.e.  I Googled until i reached this: geekWisdom 😉

  • Download source from here
  • Click on the image to view sample

You can even use a text input validator which would give you  the similar result. Depends on the requirement … one can make it as  fancy as  the one mentioned above or as simple as a validator

below is the code for textInput validation

package co.uk.BetaDesigns.utils.string
{
public class PasswordStrength{
private static var _strength : Number = 0;
private static var _regSmall : RegExp = new RegExp( /([a-z]+)/ );
private static var _regBig : RegExp = new RegExp( /([A-Z]+)/ );
private static var _regNum    : RegExp = new RegExp( /([0-9]+)/ );
private static var _regSpecial : RegExp = new RegExp( /(\W+)/ );

public static function checkStrength( password : String ) : Number{
_strength = 0;
if( password.search( _regSmall ) != -1 ){
_strength ++;
}
if( password.search( _regBig ) != -1 ){
_strength ++;
}
if( password.search( _regNum ) != -1 ){
_strength ++;
}
if( password.search( _regSpecial ) != -1 ){
_strength ++;
}
return _strength;
}
public function PasswordStrength( se : SingletonEnforcer ){
//Force it so the user can’t get here;
}
}
}
class SingletonEnforcer{}

Advertisements

1 Response to "Password Strength monitor in flex"

nice one

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

I have moved to a different location

check out my new home Flexout

calendar

October 2008
M T W T F S S
« Sep   Dec »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Blog Stat

  • 83,676 Hop's so far!!!

follow me

Archives

Linkedin Blogger Twitter Youtube Orkut

Top Clicks

  • None

latest flickr photos

deep in the jungle

little umbrella

poor jumbo!

solitude

over the rice paddy!

More Photos

top rated

%d bloggers like this: