input: Write a function to create a basic blockchain in Python using only the core modules. The function should initialize a blockchain, create blocks, and generate hashes for the blocks. If the function is called with an empty parameter, it should return an initialized blockchain.
  assert create_basic_blockchain() == {'chain': [], 'transactions': []}
  assert create_basic_blockchain().create_block(12345, '0')['block_number'] == 1
  assert len(create_basic_blockchain().chain) == 0
  assert type(create_basic_blockchain().hash_block({'block_number': 1, 'timestamp': 1641034300000, 'nonce': 12345, 'previous_hash': '0'})) == str
output: def create_basic_blockchain():
      blockchain = {'chain': [], 'transactions': []}
      
      def create_block(nonce, previous_hash):
          block = {
              'block_number': len(blockchain['chain']) + 1,
              'timestamp': int(time.time() * 1000),
              'nonce': nonce,
              'previous_hash': previous_hash
          }
          blockchain['chain'].append(block)
          return block
      
      def hash_block(block):
          block_string = json.dumps(block, sort_keys=True).encode()
          return hashlib.sha256(block_string).hexdigest()
      
      blockchain['create_block'] = create_block
      blockchain['hash_block'] = hash_block
      
      return blockchain