Generate fixed-length random string from your allowed character pool.
    
    Usage Example::
    
        >>> import string
        >>> randstr(string.ascii_letters + string.digits, 32)
        QE1UKzSrIw8z7EiEp94FJ3jwmuYNUw2N

def rand_str(allowed, length):
    """Generate fixed-length random string from your allowed character pool.
    
    Usage Example::
    
        >>> import string
        >>> randstr(string.ascii_letters + string.digits, 32)
        QE1UKzSrIw8z7EiEp94FJ3jwmuYNUw2N
    """
    if (not isinstance(length, int)) or (length <= 0):
        raise Exception("length parameter has to be an integer greater than 0!")
    
    res = list()
    for _ in range(length):
        res.append(random.choice(allowed))
    return "".join(res)