def auth_data(self, data):
    'Hashing for SHA256_MEMORY authentication.\n\n        The scramble is of the form:\n            SHA256(SHA256(SHA256(PASSWORD)),NONCE) XOR SHA256(PASSWORD)\n\n        Args:\n            data (str): The authentication data.\n\n        Returns:\n            str: The authentication response.\n        '
    password = (self._password.encode('utf-8') if isinstance(self._password, str) else self._password)
    hash1 = hashlib.sha256(password).digest()
    hash2 = hashlib.sha256((hashlib.sha256(hash1).digest() + data)).digest()
    xored = xor_string(hash2, hash1, 32)
    return '\x00{0}\x00{1}'.format(self._username, hexlify(xored))
Hashing for SHA256_MEMORY authentication.

The scramble is of the form:
    SHA256(SHA256(SHA256(PASSWORD)),NONCE) XOR SHA256(PASSWORD)

Args:
    data (str): The authentication data.

Returns:
    str: The authentication response.
def auth_data(self, data):
    'Hashing for SHA256_MEMORY authentication.\n\n        The scramble is of the form:\n            SHA256(SHA256(SHA256(PASSWORD)),NONCE) XOR SHA256(PASSWORD)\n\n        Args:\n            data (str): The authentication data.\n\n        Returns:\n            str: The authentication response.\n        '
    password = (self._password.encode('utf-8') if isinstance(self._password, str) else self._password)
    hash1 = hashlib.sha256(password).digest()
    hash2 = hashlib.sha256((hashlib.sha256(hash1).digest() + data)).digest()
    xored = xor_string(hash2, hash1, 32)
    return '\x00{0}\x00{1}'.format(self._username, hexlify(xored))