def set_chksum(self, doc, chk_sum):
if chk_sum:<EOL><INDENT>doc.ext_document_references[-<NUM_LIT:1>].check_sum = checksum.Algorithm(<EOL>'<STR_LIT>', chk_sum)<EOL><DEDENT>else:<EOL><INDENT>raise SPDXValueError('<STR_LIT>')<EOL><DEDENT>
Sets the external document reference's check sum, if not already set.
chk_sum - The checksum value in the form of a string.