captiveportal.py 文件源码

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

项目:ooniprobe-debian 作者: TheTorProject 项目源码 文件源码
def get_random_url_safe_string(self, length):
        """
        Returns a random url-safe string of specified length, where
        0 < length <= 256. The returned string will always start with
        an alphabetic character.
        """
        if length <= 0:
            length = 1
        elif length > 256:
            length = 256

        random_string = ''
        while length > 0:
            random_string += random.choice(string.lowercase)
            length -= 1

        return random_string
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号