public static int pwdLevel(String pwd) {
		if (pwd == null || !pwd.matches("[a-z0-9A-Z]{6,12}$")) {
			return -1;
		}
		int ple = 0;
		if (Pattern.compile("[0-9]").matcher(pwd).find()) {//
			ple = ple + 1;
		}
		if (Pattern.compile("[a-z]").matcher(pwd).find()) {//
			ple = ple + 1;
		}
		if (Pattern.compile("[A-Z]").matcher(pwd).find()) {//
			ple = ple + 1;
		}
		char[] charArray = pwd.toUpperCase().toCharArray();
		int arrayLe = charArray.length;
		int charSum = 0;
		int max = 0;
		int avg = 0;
		for (int i = 0; i < arrayLe; i++) {
			int cui = (int) charArray[i];
			charSum = charSum + cui;
			if (cui > max) {
				max = cui;
			}
		}
		avg = charSum / arrayLe;
		if (Math.abs(avg - max) <= 4) {
			if (ple > 1) {
				ple = ple - 1;
			}
		}
		return ple;
	}