zut.secret.generate_random_string

zut.secret.generate_random_string(length: int, *, allowed_chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', force_symbols=False) str

Return a securely generated random string.

Parameters:
  • length – Number of characters in the resulting string.

  • allowed_chars – String containing the allowed chars.

  • force_symbols – Ensure that the generated string contains at least one digit, one lowercase letter, one uppercase letter, and one symbol within the first 16 characters.