import random
import string


def create_nonceStr(num):
    """
    产生随机字符串
    :param num:产生随机字符串的位数
    :return:随机字符串 string
    """
    salt = ''.join(random.sample(string.ascii_letters + string.digits, num))
    return salt