input: Write a function to create a basic blockchain in Python using only the core modules, including the ability to create a new block, generate a timestamp, and hash a block. The function should return an instance of the Blockchain class with the following methods: __init__, create_block, _current_timestamp, and hash_block. The create_block method should take two parameters: nonce and previous_hash, and return the created block. The hash_block method should take a block as a parameter and return its hash.
  assert isinstance(create_blockchain(), Blockchain)==True
  blockchain = create_blockchain()
  block = blockchain.create_block(nonce=12345, previous_hash="0")
  assert 'block_number' in block==True
  assert 'timestamp' in block==True
  assert 'nonce' in block==True
  assert 'previous_hash' in block==True
  hash = blockchain.hash_block(block)
  assert len(hash)==64
output: class Blockchain:
      def __init__(self):
          self.chain = []
  
      def create_block(self, nonce, previous_hash):
          block = {
              'block_number': len(self.chain) + 1,
              'timestamp': self._current_timestamp(),
              'nonce': nonce,
              'previous_hash': previous_hash
          }
          self.chain.append(block)
          return block
  
      def _current_timestamp(self):
          return datetime.datetime.now().isoformat()
  
      def hash_block(self, block):
          block_string = json.dumps(block, sort_keys=True).encode()
          return hashlib.sha256(block_string).hexdigest()
  
  def create_blockchain():
      return Blockchain()