import pickle
import hashlib
import os

def computeHash(data):
    hash = hashlib.sha256()
    data = str(data).encode()
    hash.update(data)
    return hash.hexdigest()

def clearScreen():
    os.system('cls' if os.name == 'nt' else 'clear')

def saveFile(fileloc, data):
    savefile = open(fileloc, "ab")
    pickle.dump(data, savefile)
    savefile.close()

def loadFile(fileloc):
    loadfile = open(fileloc ,"rb")

    objs = []
    while True:
        try:
            objs.append(pickle.load(loadfile))
        except EOFError:
            break

    return objs