input: Write a function to implement a basic blockchain in Python using only the core modules. The function should define a `Blockchain` class with methods to initialize the blockchain, create a new block, and hash a block. Additionally, provide a test case with an assertion to verify the functionality of the blockchain.
  
  
  def implement_blockchain():
      import hashlib
      import json
      import time
  
      class Blockchain:
  
          def __init__(self):
              self.chain = []
              self.transactions = []
  
          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 round(time.time() * 1000)
  
          def hash_block(self, block):
              string_object = json.dumps(block, sort_keys=True)
              block_string = string_object.encode()
              raw_hash = hashlib.sha256(block_string)
              hex_hash = raw_hash.hexdigest()
              return hex_hash
  
      # Test case
      blockchain = Blockchain()
      block1 = blockchain.create_block(12345, "0")
      assert blockchain.hash_block(block1) == hashlib.sha256(json.dumps(block1, sort_keys=True).encode()).hexdigest()
      return blockchain
  
output: 
  import hashlib
  import json
  import time
  
  class Blockchain:
  
      def __init__(self):
          self.chain = []
          self.transactions = []
  
      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 round(time.time() * 1000)
  
      def hash_block(self, block):
          string_object = json.dumps(block, sort_keys=True)
          block_string = string_object.encode()
          raw_hash = hashlib.sha256(block_string)
          hex_hash = raw_hash.hexdigest()
          return hex_hash
  