How to use the ciphey.basemods.Searchers.ausearch.Node function in ciphey

To help you get started, weโ€™ve selected a few ciphey examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brandonskerritt / Ciphey / ciphey / basemods / Searchers / ausearch.py View on Github external
if success:
                return True, eval_res
            nodes.extend(eval_res)

        crackers: List[Cracker] = registry[Cracker[type(result)]]
        expected_time: float

        # Worth doing this check twice to simplify code and allow a early return for decodings
        if type(result) == self._final_type:
            expected_time = self._checker.getExpectedRuntime(result)
        else:
            expected_time = 0
        for i in crackers:
            cracker = self._config()(i)
            nodes.append(
                Node(
                    cracker=cracker,
                    crack_info=cracker.getInfo(result),
                    check_info=expected_time,
                    parents=parents,
                )
            )

        return False, nodes
github brandonskerritt / Ciphey / ciphey / basemods / Searchers / ausearch.py View on Github external
# logger.debug(f"Expanding {parents}")

        # Deduplication
        if not self._config().cache.mark_ctext(result):
            return False, []

        if check and type(result) == self._final_type:
            check_res = self._checker(result)
            if check_res is not None:
                return True, SearchResult(path=parents, check_res=check_res)

        success, dec_res = self.handleDecodings(result)
        if success:
            return True, SearchResult(path=parents + [dec_res[0]], check_res=dec_res[1])

        nodes: List[Node] = []

        for decoding in dec_res:
            # Don't check, as handleDecodings did that for us
            success, eval_res = self.expand(parents + [decoding], check=False)
            if success:
                return True, eval_res
            nodes.extend(eval_res)

        crackers: List[Cracker] = registry[Cracker[type(result)]]
        expected_time: float

        # Worth doing this check twice to simplify code and allow a early return for decodings
        if type(result) == self._final_type:
            expected_time = self._checker.getExpectedRuntime(result)
        else:
            expected_time = 0