Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring and whatnot #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Refactoring and whatnot #18

wants to merge 1 commit into from

Conversation

agvxov
Copy link

@agvxov agvxov commented Nov 19, 2024

I used pseudo hash for a personal project, however I needed more fine grained control over the generated password list than what was possible over the cli.
Long story short, while initially wanting to make small edits, I ended up changing every line.

Here is the list of changes:

  • removed orphaned function unique()
  • normalized camelCase
  • moved argument parsing into a function;
    for the same reason main() is a function;
    either the ability load as a module or readability,
    choose whichever explanation you like
  • aligned code
  • fixed oversights such as if b: return True else return False and for a in A: B.append(a)
  • def ask_for_consent()
  • def illegal_years_input() # (the original repeats itself); this is a very questionable restraint btw
  • trans_keys should have never existed; transformations is a dictionary now, instead of a list of dictionaries
  • simplified year range split
  • moved runtime configurable data into object opts, instead of having them half split between globals AND args;
    opts is declared at the top with its defaults, making the script much nicer to peak into during "work"
  • print error if the output file cannot be created, instead of just throwing
  • pass the wordlist file as an argument to mutating functions;
    i haven't benchmarked it, however, i'm positive repeatedly opening and closing a file takes time
  • "seperator" is not a word, "separator" is
  • --no-transformations flag
  • a config script is attempted to be imported; this allows users to modify all globals very cleanly (e.g. passing transformations from the cli would be awkward; words could be dynamically generated)

I know having only one commit makes code-review significantly harder. I'm sincerely sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant