LoveCausesMadness.py 文件源码

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

项目:CTF 作者: calee0219 项目源码 文件源码
def checkFactorDB(n):
    """See if the modulus is already factored on factordb.com,
     and if so get the factors"""
    # Factordb gives id's of numbers, which act as links for full number
    # follow the id's and get the actual numbers

    r = requests.get('http://www.factordb.com/index.php?query=%s' % str(n))
    regex = re.compile("index\.php\?id\=([0-9]+)", re.IGNORECASE)
    ids = regex.findall(r.text)
    # These give you ID's to the actual number
    num = len(ids)-2
    print(ids)
    print(num)
    if num < 2: return 0
    else: return num * (num-1) / 2


#print solve('1ELuX8Do1NDSMy4eV8H82dfFtTvKaqYyhg')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号