import random
import hashlib


def sha256(*args):
    """Generates SHA256 based on the provided string or a random int"""
    value = ""
    if len(args) > 0:
        value = args[0]
    if value == "":
        value = str(random.getrandbits(256))
    return hashlib.sha256(value.encode('utf-8')).hexdigest()