def create_artifact(entity_id, message_handle, endpoint_index=0):
 sourceid = sha1(entity_id)
 ter = ('%s%.2x%s%s' % (ARTIFACT_TYPECODE, endpoint_index, sourceid.digest(), message_handle))
 return base64.b64encode(ter)

def create_artifact ( entity_id , message_handle , endpoint_index = 0 ) : sourceid = sha1 ( entity_id ) ter = ( '%s%.2x%s%s' % ( ARTIFACT_TYPECODE , endpoint_index , sourceid . digest ( ) , message_handle ) ) return base64 . b64encode ( ter )
saml_artifact := b64 typecode := byte1byte2 endpointindex := byte1byte2 remainingartifact := sourceid messagehandle sourceid := 20-byte_sequence messagehandle := 20-byte_sequence .