File: gen_fuzz_strings.py

package info (click to toggle)
graphql-core 3.2.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,384 kB
  • sloc: python: 45,812; makefile: 26; sh: 13
file content (10 lines) | stat: -rw-r--r-- 377 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from itertools import product
from typing import Generator

__all__ = ["gen_fuzz_strings"]


def gen_fuzz_strings(allowed_chars: str, max_length: int) -> Generator[str, None, None]:
    """Generator that produces all possible combinations of allowed characters."""
    for length in range(max_length + 1):
        yield from map("".join, product(allowed_chars, repeat=length))