input: Write a function to implement a basic blockchain in Python using only the core modules. The function should include methods to initialize the blockchain, create new blocks, and hash blocks using SHA-256. The function should return the entire blockchain after creating a new block.
  assert (create_blockchain()
   .create_block(nonce=23, previous_hash="0"))['block_number'] == 1
  assert len(create_blockchain()
   .create_block(nonce=24, previous_hash="0x123")['chain']) == 1
  assert type(create_blockchain()
   .hash_block({'block_number': 1, 'timestamp': 1234567890, 'nonce': 23, 'previous_hash': "0"})) == str
  assert create_blockchain()
   .hash_block({'block_number': 1, 'timestamp': 1234567890, 'nonce': 23, 'previous_hash': "0"}) != create_blockchain()
   .hash_block({'block_number': 1, 'timestamp': 1234567891, 'nonce': 23, 'previous_hash': "0"})
output: def create_blockchain():
      import hashlib
      import time
  
      class Blockchain:
          def __init__(self):
              self.chain = []
              self.create_block(nonce=0, previous_hash="0")
  
          def create_block(self, nonce, previous_hash):
              block = {
                  'block_number': len(self.chain) + 1,
                  'timestamp': time.time(),
                  'nonce': nonce,
                  'previous_hash': previous_hash
              }
              block['hash'] = self.hash_block(block)
              self.chain.append(block)
              return self
  
          def hash_block(self, block):
              block_string = (
                  str(block['block_number']) +
                  str(block['timestamp']) +
                  str(block['nonce']) +
                  block['previous_hash']
              ).encode()
              return hashlib.sha256(block_string).hexdigest()
  
      return Blockchain()