zoukankan      html  css  js  c++  java
  • js中验证密码是否是弱密码的4个方法 密码至少包含小写字母、大写字母、数字、特殊字符中的3类密码长度至少8位

    //验证密码是否是弱密码的4个方法 密码至少包含小写字母、大写字母、数字、特殊字符中的3类

    //  /g表示全局
    function isContainNum(pwd){
    return pwd.match(/d+/g)==null ? false : true; } function isContainLowChar(pwd){ return pwd.match(/[a-z]+/g)==null ? false : true; } function isContainUpChar(pwd){ return pwd.match(/[A-Z]+/g)==null ? false : true; } function isContainEspChar(pwd){ return pwd.match(/[~!@#$%^&*()_=+]+/g)==null ? false : true; } //判断用户输入的密码是否是弱密码 function checkPassword(password){ if(isContainNum(password)&&isContainLowChar(password)&&isContainUpChar(password)){ return true; }else if(isContainNum(password)&&isContainLowChar(password)&&isContainEspChar(password)){ return true; }else if(isContainNum(password)&&isContainUpChar(password)&&isContainEspChar(password)){ return true; }else if(isContainLowChar(password)&&isContainUpChar(password)&&isContainEspChar(password)){ return true; }else{ return false; } }



  • 相关阅读:
    sa-token v1.9.0 版本已发布,带来激动人心新特性:同端互斥登录
    为什么类只能用public修饰?
    Sentinel导航
    Ribbon导航
    Feign导航
    Gateway导航
    Nacos导航
    Nginx导航
    微服务导航
    Springboot之登录模块探索(含Token,验证码,网络安全等知识)
  • 原文地址:https://www.cnblogs.com/xiaotang5051729/p/9674884.html
Copyright © 2011-2022 走看看