CoreFiles by mySites.guru
password-strength-meter.js23 lines, 717 bytes, from wordpress-2.7.zip
Raw History Compare with 2.6.5
md5
9fd543dc193265cafad84bd8a0d7f34d
sha1
69e7ad57dafb48d807b92d53e83df1aceae6d6d5
sha256
a277a6133d8b72b9cc693d85eec976f74761b74f1dffba869058f01caa0caf8c
// 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 5 releases, WordPress 2.7-RC2 to 2.7.1. See them all, or every version of this file.