Compute a hash. This is somewhat resistant to errors, e.g. if somehow the date is None,
        this will still work.

def compute_hash(self, noteId, date, title):
        '''
        Compute a hash. This is somewhat resistant to errors, e.g. if somehow the date is None,
        this will still work.
        '''
        if not noteId:
            noteId = ''.join(random.choice(string.digits) for _ in range(4))
        if not date:
            date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        if not title:
            title = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(100))
        #print(str(title)+str(noteId)+str(date))
        return(hashlib.sha256((str(title) + str(noteId) + str(date)).encode('utf8')).hexdigest())