Conversation
|
@VamatoHD Nice idea, to be honest. The permutation feature was a bit inconsistent, it produced random username and email variations without much control. This approach gives users a lot more control and flexibility. |
|
I've added a function to iterate the usernames/emails randomly. |
|
Cover expand_patterns and expand_patterns_random: - Plain text, charset ranges, explicit chars, prefix/suffix - Lenset: single values, ranges, semicolons, zero-length - Escaped characters: brackets, backslash, inside charset - Error cases: unclosed brackets/braces, unmatched close bracket - Complex: multiple blocks, mixed text and patterns - Random: set equivalence, reservoir sampling, islice Ref kaifcodec#184
- Fix `if res:` to `if res is not None:` in parse_number (falsy when 0) - Add descriptive message to bare ValueError in charset range - Replace `[char for char in input]` with `list(input)` - Rename `list` parameter to `blocks` to avoid shadowing builtin - Fix typo "unscaped" to "unescaped" - Remove redundant sorted() call (lenset already sorted at construction) Ref kaifcodec#184
Add count_patterns(input) -> int that returns the total number of expansions without generating them. Runs in O(number of blocks), useful for informing users how many permutations a pattern produces. Add docstrings to all public functions: expand_patterns, expand_patterns_random, and count_patterns. Ref kaifcodec#184
Use count_patterns() to display how many permutations exist in total, e.g. "Scanning 5 of 111 permutations" instead of "Generated 5 permutations". Gives users visibility into the full scope of their pattern. Ref kaifcodec#184
|
Hey @VamatoHD, I opened #265 to help with the remaining TODO items:
The PR is based on your |
a7420e4
This is a draft of a new feature that replaces
generate_permutationsentirely.It's a small parser I wrote that converts and expands the string based on
[<chars>]{<lens>}.Syntax:
When you want an automatic pattern to be expanded, you use:
[<list of characters>]followed by (optional){<list of lengths separated by ";">}For example:
TODO: