PageSourceSearch

https://www.quyu.net/includes/jscript/pwstrength.js

js quyu.net collected 2026-10-08 08:36:58 UTC 2,459 bytes, 56 lines download raw bytes

1jQuery(document).ready(function(){
2    if(typeof window.langPasswordWeak === 'undefined'){
3        window.langPasswordWeak = "Weak";
4    }
5    if(typeof window.langPasswordModerate === 'undefined'){
6        window.langPasswordModerate = "Moderate";
7    }
8    if(typeof window.langPasswordStrong === 'undefined'){
9        window.langPasswordStrong = "Strong";
10    }
11
12    jQuery("#newpw").keyup(function () {
13        var pwvalue = jQuery("#newpw").val();
14        var pwstrength = getPasswordStrength(pwvalue);
15        jQuery("#pwstrength").html(langPasswordStrong);
16        jQuery("#pwstrengthpos").css("background-color","#33CC00");
17        if (pwstrength<75) {
18            jQuery("#pwstrength").html(langPasswordModerate);
19            jQuery("#pwstrengthpos").css("background-color","#ff6600");
20        }
21        if (pwstrength<30) {
22            jQuery("#pwstrength").html(langPasswordWeak);
23            jQuery("#pwstrengthpos").css("background-color","#cc0000");
24        }
25        jQuery("#pwstrengthpos").css("width",pwstrength);
26        jQuery("#pwstrengthneg").css("width",100-pwstrength);
27    });
28});
29
30function getPasswordStrength(pw){
31    var pwlength=(pw.length);
32    if(pwlength>5)pwlength=5;
33    var numnumeric=pw.replace(/[0-9]/g,"");
34    var numeric=(pw.length-numnumeric.length);
35    if(numeric>3)numeric=3;
36    var symbols=pw.replace(/\W/g,"");
37    var numsymbols=(pw.length-symbols.length);
38    if(numsymbols>3)numsymbols=3;
39    var numupper=pw.replace(/[A-Z]/g,"");
40    var upper=(pw.length-numupper.length);
41    if(upper>3)upper=3;
42    var pwstrength=((pwlength*10)-20)+(numeric*10)+(numsymbols*15)+(upper*10);
43    if(pwstrength<0){pwstrength=0}
44    if(pwstrength>100){pwstrength=100}
45    return pwstrength;
46}
47
48function showStrengthBar() {
49    if(typeof window.langPasswordStrength === 'undefined'){
50        window.langPasswordStrength = "Password Strength";
51    }
52    if(typeof window.langPasswordWeak === 'undefined'){
53        window.langPasswordWeak = "Weak";
54    }
55    document.write('<table align="center"><tr><td>'+langPasswordStrength+':</td><td width="102"><div id="pwstrengthpos" style="position:relative;float:left;width:0px;background-color:#33CC00;border:1px solid #000;border-right:0px;">&nbsp;</div><div id="pwstrengthneg" style="position:relative;float:right;width:100px;background-color:#efefef;border:1px solid #000;border-left:0px;">&nbsp;</div></td><td><div id="pwstrength">'+langPasswordWeak+'</div></td></tr></table>');
56}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.