tools.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Cryptical 作者: mathieudev 项目源码 文件源码
def id_generator(size=8, chars=string.ascii_uppercase + string.digits):
    """Generate a random id.

    This function generate a random id containing uppercase and digits.

    :parameter:
     size : int
        The id length in number of chars.
     chars : strings
        The elements to use to create random id.

    :return: A string, the random generated id.
    """

    return ''.join(random.choice(chars) for _ in range(size))


# Takes list of files as argument, put them in tar archive and return it.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号