import random
import string


def randomstring(N):
    """ Generate a random string of length N """
    return "".join(
        random.choice(string.ascii_letters + string.digits) for _ in range(N)
    )