from typing import List
import random


def gen_sha(charset: List[str], length: int):
    """Partial function for generating a long string of random characters."""

    def inner() -> str:
        return ''.join(random.choice(charset) for _ in range(length))
    return inner