Chrome Extension

Password Checker

let passwordChecker = (password) => {
	if (isUpperCase(password) && isLowerCase(password) && isNumber(password) && isProperLength(password) && consOcc(password)){
		return true
	} else {
		return false
	}
}

let consOcc = (password) => {
	let init = password.charAt(0)
	let count = 1
	for (let i=1; i < password.length; i++) {
		if (password.charAt(i) == init) {
			init = password.charAt(i)
			count++
			if (count > 2) {
				return false
			}
		} else {
			init = password.charAt(i)
			count = 1 
		}
	}
	if (count>=3) {
		return false	
	}
	else {
		return true
	}
	// 
}

let isUpperCase = (password) => {
	return /[A-Z]/.test(password)
}

let isLowerCase = (password) => {
	return /[a-z]/.test(password)
}

let isNumber = (password) => {
	return /[0-9]/.test(password)
}

let isProperLength = (password) => {
	if (password.length >= 6 && password.length <= 16) {
		return true;
	}
	return false
}

1 UPPERCASE

1 lowercase

1 number

length between 6-16

no 3 consecutive letter (ghvaaa7867) X

Search history ×