CoreFiles by mySites.guru
password-strength-meter.js23 lines, 722 bytes, from wordpress-2.7-beta2.zip
Raw History Compare with 2.7-beta1
md5
6fddcd0d2bd392e99e419e12853d1285
sha1
dae7c9c80083d6bf28d0f3683436c33665dc6455
sha256
c9d230323808c4e7e6dcba30a6ad06d71145ad2b61541bb393edf5ec2af76bad
// Password strength meter

function passwordStrength(password,username) {
    var shortPass = 1, badPass = 2, goodPass = 3, strongPass = 4;

	//password < 4
    if (password.length < 4 ) { return shortPass };

    //password == username
    if (password.toLowerCase()==username.toLowerCase()) return badPass;

	var symbolSize = 0;
	if (password.match(/[0-9]/)) symbolSize +=10;
	if (password.match(/[a-z]/)) symbolSize +=26;
	if (password.match(/[A-Z]/)) symbolSize +=26; 
	if (password.match(/[^a-zA-Z0-9]/)) symbolSize +=31;
    
	var natLog = Math.log( Math.pow(symbolSize,password.length) );
	var score = natLog / Math.LN2;
	if (score < 40 )  return badPass
	if (score < 56 )  return goodPass
    return strongPass;
}

The same content is in 4 releases, WordPress 2.7-beta1 to 2.7-RC1. See them all, or every version of this file.