def generate_secret(length=32):
  """
  Generate a random secret consisting of mixed-case letters and numbers
  Args:
      length (int): Length of the generated password
  Returns:
      a randomly generated secret string
  Raises:
      None
  """
  alphabet = string.ascii_letters + string.digits
  random_bytes = os.urandom(length)
  indices = [int(len(alphabet) * (ord(byte) / 256.0)) for byte in random_bytes]
  return "".join([alphabet[index] for index in indices])