def locateMark(mark, payload):
 index = payload.find(mark, 0, (const.MAX_PADDING_LENGTH + const.MARK_LENGTH))
 if (index < 0):
  log.debug('Could not find the mark just yet.')
  return None
 if (((len(payload) - index) - const.MARK_LENGTH) < const.HMAC_SHA256_128_LENGTH):
  log.debug('Found the mark but the HMAC is still incomplete.')
  return None
 log.debug('Successfully located the mark.')
 return index

def locateMark ( mark , payload ) : index = payload . find ( mark , 0 , ( const . MAX_PADDING_LENGTH + const . MARK_LENGTH ) ) if ( index < 0 ) : log . debug ( 'Could not find the mark just yet.' ) return None if ( ( ( len ( payload ) - index ) - const . MARK_LENGTH ) < const . HMAC_SHA256_128_LENGTH ) : log . debug ( 'Found the mark but the HMAC is still incomplete.' ) return None log . debug ( 'Successfully located the mark.' ) return index
locate the given mark in payload and return its index .