Make WordPress Core

Ticket #21737: 21737.zxcvbn-rot13.diff

File 21737.zxcvbn-rot13.diff, 1.2 KB (added by duck_, 12 years ago)
  • matching.coffee

    diff --git a/matching.coffee b/matching.coffee
    index 2d104e7..b822754 100644
    a b  
    11
     2rot_13 = (str) ->
     3  str.replace /[a-zA-Z]/g, (c) ->
     4    String.fromCharCode (if ((if c <= "Z" then 90 else 122)) >= (c = c.charCodeAt(0) + 13) then c else c - 26)
     5
    26empty = (obj) -> (k for k of obj).length == 0
    37extend = (lst, lst2) -> lst.push.apply lst, lst2
    48translate = (string, chr_map) -> (chr_map[chr] or chr for chr in string.split('')).join('')
    dictionary_match = (password, ranked_dict) -> 
    2226  result = []
    2327  len = password.length
    2428  password_lower = password.toLowerCase()
     29  password_lower = rot_13(password_lower)
    2530  for i in [0...len]
    2631    for j in [i...len]
    2732      if password_lower[i..j] of ranked_dict
  • scripts/build_frequency_lists.py

    diff --git a/scripts/build_frequency_lists.py b/scripts/build_frequency_lists.py
    index 015f795..aa256eb 100644
    a b def filter_ascii(lst): 
    145145    return [word for word in lst if all(ord(c) < 128 for c in word)]
    146146
    147147def to_js(lst, lst_name):
     148    lst = map(lambda x : codecs.encode(x, 'rot_13'), lst)
    148149    return 'var %s = %s;\n\n' % (lst_name, simplejson.dumps(lst))
    149150
    150151def main():