Return ----- ➋
def crack_password_parallel(crypto_hash: str, length: int) -> None:
num_cores = os.cpu_count() ----- ➌
print("패스워드 후보를 동시적으로 처리하는 중")
start_time = time.perf_counter()
with Pool() as pool:
arguments = ((crypto_hash, length, chunk_start, chunk_end) for
chunk_start, chunk_end in
get_chunks(num_cores, length))
results = pool.starmap(crack_chunk, arguments) ----- ➍
print("후보 뭉치의 처리 완료를 기다리는 중")
pool.close() ----- ➎
pool.join() ----- ➏
result = [res for res in results if res]
print(f"크랙된 패스워드: {result[0]}")
process_time = time.perf_counter() - start_time