|
|
|
@ -1,11 +1,11 @@ |
|
|
|
from string import ascii_lowercase as alphabet |
|
|
|
import codecs |
|
|
|
import hashlib |
|
|
|
import json |
|
|
|
import os |
|
|
|
import multiprocessing |
|
|
|
import os |
|
|
|
import pickle |
|
|
|
import re |
|
|
|
from string import ascii_lowercase as alphabet |
|
|
|
import sys |
|
|
|
#32 or 64 bit platform? |
|
|
|
if sys.maxsize > 2**32: |
|
|
|
@ -78,10 +78,10 @@ class bool_regex: |
|
|
|
return bool(self.expr.match(arg)) |
|
|
|
def filter_wordlist(input,remaining_letters,word_list,mp=True): |
|
|
|
regex = re.compile(input.replace('.','[{}]'.format(''.join(remaining_letters))) + '$') |
|
|
|
if mp: |
|
|
|
if mp and len(word_list) > 1000: |
|
|
|
regex = bool_regex(regex) |
|
|
|
pool = multiprocessing.Pool() |
|
|
|
matches = pool.map(regex,word_list) |
|
|
|
matches = pool.map(regex,word_list,100_000) |
|
|
|
pool.close() |
|
|
|
pool.join() |
|
|
|
else: |
|
|
|
|