import random


def random_string(charset, min_length, max_length):
  """
  Generate a string from the given character set (charset), between min_length
  and max_length, inclusive.
  """
  length = random.randint(min_length, max_length)

  return ''.join([random.choice(charset) for i in range(length)])