惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
F
Full Disclosure
Cloudbric
Cloudbric
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
N
News and Events Feed by Topic
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
GbyAI
GbyAI
C
Check Point Blog
B
Blog RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recorded Future
Recorded Future
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
T
The Blog of Author Tim Ferriss
O
OpenAI News
V
V2EX
人人都是产品经理
人人都是产品经理
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Security @ Cisco Blogs
C
Cisco Blogs
Security Latest
Security Latest
S
Security Affairs
V
Visual Studio Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
PCI Perspectives
PCI Perspectives
博客园_首页
U
Unit 42
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
L
LINUX DO - 热门话题
H
Hacker News: Front Page

博客园 - lrary

JavaScript经典技巧 - lrary - 博客园 动态添加ASP.NET控件并绑定处理事件一例 - lrary - 博客园 脚本收藏 - lrary - 博客园 一些sql语句的详细解释[转] 特殊的DataGrid的绑定 - lrary - 博客园 纯脚本搞掂DataGrid表表头不动,表身滚动。(转摘) - lrary - 博客园 数据库设计规范 V2.0 SQL语句特---殊统计(1) DataGrid 多行 DataGrid怎么产生一个分类的题头 AJAX 在.net的应用 sql怎么使用外连接 Asp.NET程序中常用的三十三种代码 检测含有中文字符串的实际长度 根据区位得到汉字拼音首字母(c#) 认识ASP.NET配置文件Web.config Asp.net(C#)实现验证码功能 给Repeater、Datalist和Datagrid增加自动编号列 查找和统计页面上控件
检验密码强度的JS类 - lrary - 博客园
lrary · 2006-05-16 · via 博客园 - lrary

<script type="text/javascript">
        
var PasswordStrength ={
            Level : [
"高,实在是高","还行啦","靠,这样也行"],
            LevelValue : [
30,20,0],//强度值
            Factor : [1,2,5],//字符加数,分别为字母,数字,其它
            KindFactor : [0,0,10,20],//密码含几种组成的加数 
            Regex : [/[a-zA-Z]/g,/\d/g,/[^a-zA-Z0-9]/g] //字符正则数字正则其它正则
            }
        PasswordStrength.StrengthValue 
= function(pwd)
        {
            
var strengthValue = 0;
            
var ComposedKind = 0;
            
for(var i = 0 ; i < this.Regex.length;i++)
            {
                
var chars = pwd.match(this.Regex[i]);
                
if(chars != null)
                {
                    strengthValue 
+= chars.length * this.Factor[i];
                    ComposedKind 
++;
                }
            }
            strengthValue 
+= this.KindFactor[ComposedKind];
            
return strengthValue;
        } 
        PasswordStrength.StrengthLevel 
= function(pwd)
        {
            
var value = this.StrengthValue(pwd);
            
for(var i = 0 ; i < this.LevelValue.length ; i ++)
            {
                
if(value >= this.LevelValue[i] )
                    
return this.Level[i];
            }
        }
       
        alert(PasswordStrength.StrengthLevel(
"23")); 
        alert(PasswordStrength.StrengthLevel(
"abcd123"));     
        alert(PasswordStrength.StrengthLevel(
"abcd!%23"));  
    
</script>