Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var c = ["abc", "bcd", "cde", "def", "efg", "fgh", "ghi", "hij", "ijk", "jkl", "klm", "lmn", "mno", "nop", "opq", "pqr", "qrs", "rst", "stu", "tuv", "uvw", "vwx", "wxy", "xyz", "cba", "dcb", "edc", "fed", "gfe", "hgf", "ihg", "jih", "kji", "lkj", "mlk", "nml", "onm", "pon", "qpo", "rqp", "srq", "tsr", "uts", "vut", "wvu", "xwv", "yxw", "zyx", "qaz", "wsx", "edc", "rfv", "tgb", "yhn", "ujm", "esz", "rdx", "tfc", "ygv", "uhb", "ijn", "okm", "zaq", "xsw", "cde", "vfr", "bgt", "nhy", "mju", "zse", "xdr", "cft", "vgy", "bhu", "nji", "mko", "ewq", "rew", "tre", "ytr", "uyt", "iuy", "oiu", "poi", "dsa", "fds", "gfd", "hgf", "jhg", "kjh", "lkj", "cxz", "vcx", "bvc", "nbv", "mnb", "qwe", "wer", "ert", "rty", "tyu", "yui", "uio", "iop", "asd", "sdf", "dfg", "fgh", "ghj", "hjk", "jkl", "zxc", "xcv", "cvb", "vbn", "bnm"]
- , l = ["jd", "360", "bug", "com", "cloud", "password"]
- , f = ["123", "234", "345", "456", "567", "678", "789", "890", "098", "987", "876", "765", "654", "543", "432", "321"]
- , d = function(t) {
- var r = c.some((function(r) {
- return t.indexOf(r) >= 0 || t.indexOf(r.toUpperCase()) >= 0
- }
- ))
- , e = f.some((function(r) {
- return t.indexOf(r) >= 0
- }
- ))
- , n = l.some((function(r) {
- return t.indexOf(r) >= 0 || t.indexOf(r.toUpperCase()) >= 0
- }
- ));
- return !(r || e || n)
- };
- function p(t, r, e) {
- var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "cn";
- return !e || null != t && "" != t ? null == t || "" == t ? n[i].can_not_null : t.length > 30 || t.length < 8 ? n[i].more_eight_less_thirty : !/^[\x21-\x7e]*$/.test(t) || t.indexOf("\\") > -1 ? n[i].not_conform_to_rule : /^(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])(?=.*[a-z])(?=.*[()`~!+=|{}\[\]:";'<>,.?/@#$%^&*_-]))|((?=.*[0-9])(?=.*[A-Z])(?=.*[()`~!+=|{}\[\]:";'<>,.?/@#$%^&*_-]))|((?=.*[a-z])(?=.*[A-Z])(?=.*[()`~!+=|{}\[\]:";'<>,.?/@#$%^&*_-])))[\x21-\x7e]{8,30}$/.test(t) ? d(t) ? -1 != t.indexOf(r) ? n[i].cannot_incloud_userPin : "" : n[i].not_conform_to_rule : n[i].must_have_threeType : ""
- }
- function h(t) {
- var r = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
- , e = {
- len: !1,
- characterRestrict: !1,
- digital: !1,
- lowercaseLetter: !1,
- uppercaseLetter: !1,
- specialLetter: !1,
- includeLetter: !1,
- allowedWord: !1,
- allowedNumber: !1,
- allowedLetter: !1
- }
- , n = /[()`~!@#$%^&*_\-+=|{}[\]:";'<>,.?\/]/gi;
- if (!t && (e.len = !1,
- r))
- return " ";
- if (/[^a-z\d()`~!@#$%^&*_\-+=|{}[\]:";'<>,.?/]/gi.test(t)) {
- if (e.includeLetter = !1,
- r)
- return "只支持输入中文、数字、大小写字母、英文下划线“_”、中划线“-”或点“.”,不能以“.”作为首尾"
- } else
- e.includeLetter = !0;
- /\d/g.test(t) ? e.digital = !0 : e.digital = !1,
- /[a-z]/g.test(t) ? e.lowercaseLetter = !0 : e.lowercaseLetter = !1,
- /[A-Z]/g.test(t) ? e.uppercaseLetter = !0 : e.uppercaseLetter = !1,
- n.test(t) ? e.specialLetter = !0 : e.specialLetter = !1;
- var i = [e.digital, e.lowercaseLetter, e.uppercaseLetter, e.specialLetter];
- if (i.filter((function(t) {
- return t
- }
- )).length < 3) {
- if (e.characterRestrict = !1,
- r)
- return "密码必须包含大/小写字母、数字及特殊字符其中的三类"
- } else
- e.characterRestrict = !0;
- if (t.length < 8 || t.length > 30) {
- if (e.len = !1,
- r)
- return "密码长度须在8~30字符以内"
- } else
- e.len = !0;
- var a = t.toLowerCase().match(/[a-z\d]+/gi) || []
- , o = a.some((function(t) {
- return c.some((function(r) {
- return t.includes(r)
- }
- ))
- }
- ))
- , u = a.some((function(t) {
- return l.some((function(r) {
- return t.includes(r)
- }
- ))
- }
- ))
- , s = t.toLowerCase().match(/\d+/gi) || []
- , d = s.some((function(t) {
- return f.some((function(r) {
- return t.includes(r)
- }
- ))
- }
- ));
- if (o) {
- if (e.allowedLetter = !1,
- r)
- return " "
- } else
- e.allowedLetter = !0;
- if (u) {
- if (e.allowedWord = !1,
- r)
- return " "
- } else
- e.allowedWord = !0;
- if (d) {
- if (e.allowedNumber = !1,
- r)
- return " "
- } else
- e.allowedNumber = !0;
- return !!r || e
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement