def METHOD_NAME(self, contents):
    """Initialize with a string."""
    try:
        contents = contents.encode('utf-8')
    except AttributeError:
        pass
    node, _ = get_data_class('vasp.potcar').get_or_create_from_contents(contents)
    self.sha512 = node.sha512