websauna.utils.crypt module

Cryptographic utilities.

websauna.utils.crypt.generate_random_string(length, letters='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]

Generate cryptographically safe random string.

Parameters:
  • length (int) – String length
  • letters (str) – Choose from this letter pool
Return type:

str