Categories:Viewed: 4 - Published at: a few seconds ago

Write a python function to generate SHA256 for given text

def get_sha256(text):
    import hashlib
    return hashlib.sha256(text).hexdigest()

Write a python function to check if SHA256 hashed value is valid for given data or not

def check_sha256_hash(hashed, data):
    import hashlib
    return True if hashed == hashlib.sha256(data.encode()).hexdigest() else False

Write a python function to get HTML code for a given URL

def get_html(url=""):
    import urllib.request

    fp = urllib.request.urlopen(url)
    mybytes =
    mystr = mybytes.decode("utf8")