import hashlib


def double_sha256(array: bytes) -> bytes:
	"""
	Calcuate the SHA256 checksum of a bytes array twice.
	This method returns a bytes array and does not handle endianness.
	To get the hexadecimal representation of the bytes array with the preferred
	endianness, call:
	utils.convert_endianness(results).hex()
	"""
	assert isinstance(array, bytes)
	results = hashlib.sha256(hashlib.sha256(array).digest()).digest()
	assert isinstance(results, bytes)
	return results