random.py

Provides a couple of usefull functions for generating random strings by randomly chosing values from a list of possible characters

Function definitions:

core.encryption.random.randomint(minimum, maximum)[source]

Wrapper function for getting a random int

Args:
  • minimum: the minimum value
  • maximum: the maximum value
Returns:
a random integer between (including) minumum, maximum
core.encryption.random.randombase(length=None, choices='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')[source]

Wrapper function for getting a random choice from a list of choices

Args:
  • length: the length of the random string to return
  • choices: a list of choices to choose from
Returns:
A string with the specified length of random choices
core.encryption.random.randomid(length=64, choices='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*_-+.')[source]

Wrapper function for getting a random id

Produces a 64 length random string with symbols by default.

Args:
  • length: the length of the random string to return
  • choices: a list of choices to choose from
Returns:
A string with the specified length of random choices
core.encryption.random.randompassword(length=12, choices='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*_-+.')[source]

Wrapper function for getting a random password

Produces a 12 length random string with symbols by default.

Args:
  • length: the length of the random string to return
  • choices: a list of choices to choose from
Returns:
A string with the specified length of random choices
core.encryption.random.randomkey(length=8, choices='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')[source]

Wrapper function for getting a random key

Produces a 8 length random string with no symbols by default. Can be used to store longer values in the session.

Args:
  • length: the length of the random string to return
  • choices: a list of choices to choose from
Returns:
A string with the specified length of random choices