checkSequentialChars(password) {
for (let i = 0; i < password.length - 2; i++) {
const charCode = password.charCodeAt(i);
// 检查当前字符与后两个字符的ASCII码值是否连续递增
if (charCode + 1 === password.charCodeAt(i + 1) &&
charCode + 2 === password.charCodeAt(i + 2)) {
return false; // 存在连续递增序列,返回false
}
}
return true; // 未发现连续递增序列,返回true
}
如123、abc会返回false