import string
import random


def random_string(length):
    """Generate random string of the given length."""
    pool = string.ascii_letters + string.digits
    return "".join(random.choice(pool) for _ in range(length))