Skip to content

Commit

Permalink
Merge pull request #17 from XenonTheInertG/sourcery/main
Browse files Browse the repository at this point in the history
Sourcery refactored main branch
  • Loading branch information
XenonTheInertG authored Feb 19, 2022
2 parents 648d182 + e947c81 commit b916d71
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions aplc/aplc.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,18 @@ def crack(target_hash):
ncores = multiprocessing.cpu_count()
pool = multiprocessing.Pool(ncores)
# generates the matrix positions IDs
positions = []
for i in range(0,MAX_LEN):
positions.append(i)

positions = list(range(MAX_LEN))
# sets the length for each worker
params = []
count = 1
for i in range(0,MAX_LEN):
params.append([count,target_hash,positions])
count += 1

params = [
[count, target_hash, positions]
for count, _ in enumerate(range(MAX_LEN), start=1)
]

result = pool.map(lookup,params)
pool.close()
pool.join()

ret = None
for r in result:
if r is not None:
ret = r
break
return ret

return next((r for r in result if r is not None), None)

def main():
print ''
Expand Down

0 comments on commit b916d71

Please sign in to comment.