def METHOD_NAME(self, outstr, hash_output=False):
    # Hash the results if necessary.
    if hash_output:
        sha512 = hashlib.sha512()
        sha512.update(outstr.encode('utf-8'))
        outstr = sha512.hexdigest()
    return outstr