2013-08-07 01:49:02 -04:00
|
|
|
function passwordStrength(a,b,c){var d,e,f=1,g=2,h=3,i=4,j=5,k=0;return a!=c&&c.length>0?j:a.length<4?f:a.toLowerCase()==b.toLowerCase()?g:(a.match(/[0-9]/)&&(k+=10),a.match(/[a-z]/)&&(k+=26),a.match(/[A-Z]/)&&(k+=26),a.match(/[^a-zA-Z0-9]/)&&(k+=31),d=Math.log(Math.pow(k,a.length)),e=d/Math.LN2,40>e?g:56>e?h:i)}
|