if self.c[k].indexOf(s[i+3])==null then self.c[k].push(s[i+3])
else
self.c[k]=[s[i+3]]
end if
end for
end for
end function
PasswordGenerator.AllPasswords=function()
r={}
f={}
for s in self.s
for i in range(0,s.len-4)
if f.hasIndex(s[i:i+3]) then f[s[i:i+3]][s.len]=1 else f[s[i:i+3]]={s.len:1}
end for
end for
for e in f
for l in e.value.indexes
self.r(l,e.key,r)
end for
end for
o={}
for s in r.indexes
if s.len<5 then continue
a=s[0]
b=s[1]
if a==b or "HRL'AEIOU".indexOf(b)==null and "AEIOUS".indexOf(a)==null and ["CH","MC"].indexOf(a+b)==null then s=s[1]+s[2:].lower else s=s[0]+s[1:].lower
o[md5(s)]=s
o[md5(s.lower)]=s.lower
end for
return o
end function
PasswordGenerator.r=function(l,s,o)
c=s[s.len-3:]
if self.c.hasIndex(c) and s.len<l then
for c in self.c[c]
self.r(l,s+c,o)
end for
else
o[s]=1
end if
end function
libs/list.src
Lst = {}
Lst.to_list = function(map, shallow = false)
list = []
for i in map.indexes
if typeof(map[i]) == "map" then
if shallow == true then
list.push([i, map[i]])
else
list.push([i, Lst.to_list(map[i])])
end if
else
list.push([i, map[i]])
end if
end for
return list
end function
Lst.to_map = function(list)
l = list[0:]
map = {}
for i in indexes(l)
if typeof(l[i][1]) == "list" and l[i][1].len == 2 and typeof(l[i][1][0]) == "string" then
map[l[i][0]] = Lst.to_map(l[i][1])
else
map[l[i][0]] = l[i][1]
end if
end for
return map
end function
Lst.each = function(obj, func)
if typeof(obj) == "map" then
list = Lst.to_list(obj, true)
else
list = obj
end if
result = list[0:] //list copy.
for i in indexes(list)
if typeof(obj) == "map" then
func(result[i][0], result[i][1])
else
func(result[i])
end if
end for
end function
Lst.map = function(list, func)
result = list[0:] //list copy.
for i in indexes(list)
result[i] = func(result[i])
end for
return result
end function
Lst.reject = function(list, func)
result = list[0:] //list copy.
i = 0
while i < result.len
if func(result[i]) == true then
result.remove(i)
continue
end if
i = i + 1
end while
return result
end function
Lst.select = function(list, func)
result = list[0:] //list copy.
i = 0
while i < result.len
if func(result[i]) == false then
result.remove(i)
continue
end if
i = i + 1
end while
return result
end function
// do not rename funcc to to func it will infinite loop