Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

gandalf15/trustpilot_md5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trustpilot_md5

Requirements

  • Python3.9 or higher. I used PyPy3.9 for its speed.

Ideas

  1. Understand the problem.
  2. Think about how to reduce the search space.
  3. Think if spaces are part of the solution. If yes then how many?
  4. Think about what data structures can help.
  5. CPython is slow. Use JIT compiler. PyPy3

Steps for solving the challenge.

  1. Load the wordlist and remove potential duplicate words.
  2. Keep only words that can be part of the anagram. This reduced the number of words from 99 175 to 1659 words.
  3. Use Trie structure to store the 1659 words. This allows for efficient anagrams generation. For more details see "The Algorithm Design Manual", 3rd Edition by Steven Skiena page 448.
  4. Check for hash collision against the target hashes.

Example

  • Run with this command (CPython): python3.9 main.py wordlist task --log INFO.
  • Log is optional arg and values can be [DEBUG | INFO | WARNING | ERROR | CRITICAL] default is WARNING
  • For PyPy3 run with this command: pypy3.9 main.py wordlist task --log INFO

Result

See the results.txt file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages