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 a new block, and compute the hash of a block.
  assert basic_blockchain() is not None
  assert basic_blockchain().create_block(nonce=123, previous_hash='0') is not None
  assert basic_blockchain().hash_block(basic_blockchain().create_block(nonce=123, previous_hash='0')) is not None
output: def basic_blockchain():
      class Block:
          def __init__(self, nonce, previous_hash):
              self.nonce = nonce
              self.previous_hash = previous_hash
              self.timestamp = time.time()
              self.data = "Block Data"
  
      class Blockchain:
          def __init__(self):
              self.chain = []
              self.create_block(nonce=0, previous_hash='0')
  
          def create_block(self, nonce, previous_hash):
              block = Block(nonce, previous_hash)
              self.chain.append(block)
              return block
  
          def hash_block(self, block):
              block_string = f"{block.nonce}{block.previous_hash}{block.timestamp}{block.data}"
              return hashlib.sha256(block_string.encode()).hexdigest()
  
      return Blockchain()