Job 0 - Solution (An Example Solution for Odd Job 0)


Hello,


See code below:



    import os
    from hashlib import sha256
    import sys
    
    try:
        assert len(sys.argv) == 2
    except AssertionError:
        raise Exception("Missing website url try running: python url2code.py {webiste-url}")
    
    url = sys.argv[1]
    output_stream = os.popen("curl " + url)
    urlcontent = output_stream.read()
    hex = sha256(urlcontent.encode('utf-8')).hexdigest()
    print(hex)
    
    hex_sum = 0
    for c in hex:
        hex_sum += int(c, 16)
    print("If code is 484 please check website and try again.")
    print("URL content code:", hex_sum)

Download