def SetHasherNames(self, hasher_names_string): """Sets the hashers that should be enabled. Args: hasher_names_string (str): comma separated names of hashers to enable. """ hasher_names = hashers_manager.HashersManager.GetHasherNamesFromString( hasher_names_string) debug_hasher_names = ', '.join(hasher_names) logger.debug('Got hasher names: {0:s}'.format(debug_hasher_names)) self._hashers = hashers_manager.HashersManager.GetHashers(hasher_names) self._hasher_names_string = hasher_names_string
def GetResults(self): """Retrieves the hashing results. Returns: list[AnalyzerResult]: results. """ results = [] for hasher in self._hashers: logger.debug('Processing results for hasher {0:s}'.format(hasher.NAME)) result = analyzer_result.AnalyzerResult() result.analyzer_name = self.NAME result.attribute_name = hasher.ATTRIBUTE_NAME result.attribute_value = hasher.GetStringDigest() results.append(result) return results