input: Write a function to create a basic blockchain in Python using only the core modules and implement a method to create a block and a method to hash a block. If the blockchain is initialized with an empty chain, the function should return the chain and the block creation and hashing methods should follow the correct logic.
  assert Blockchain().chain == []
  assert Blockchain().create_block(nonce=123, previous_hash="0").block_number == 1
  assert len(Blockchain().hash_block({"block_number": 1, "timestamp": 1234567890, "nonce": 123, "previous_hash": "0"})) == 64
output: class Blockchain:
      def __init__(self):
          self.chain = []
          self.block_number = 0
  
      def create_block(self, nonce, previous_hash):
          self.block_number += 1
          block = {
              "block_number": self.block_number,
              "timestamp": int(time.time()),
              "nonce": nonce,
              "previous_hash": previous_hash
          }
          self.chain.append(block)
          return block
  
      def hash_block(self, block):
          block_string = json.dumps(block, sort_keys=True).encode()
          return hashlib.sha256(block_string).hexdigest()