public final void findAlgorithm() {
        // try to find the function name of the signature generator
        String functionName = StringUtils.substringBetween(jsEntity, "signature=", "(");
        // try to find the algorithm
        String sigAlg = functionName.concat("(a){")
                .concat(StringUtils.substringBetween(jsEntity, functionName.concat("(a){"), "}")).concat("}");

        // Auxiliary, if the algorithm calls another function, this will find that two
        String otherFunctionName = null;
        for (String s : sigAlg.split(";")) {
            if (!s.contains("a.") && s.contains("a=")) {
                otherFunctionName = StringUtils.substringBetween(s, "=", "(");
                break;
            }
        }

        // Gets the algorithm for the auxiliary function
        String helpSigAlg = null;
        if (otherFunctionName != null) {
            helpSigAlg =  otherFunctionName.concat("(a,b){")
                    .concat(StringUtils.substringBetween(jsEntity, otherFunctionName.concat("(a,b){"), "}"))
                    .concat("}");
        }

        signatureGeneratorAlgorithm = String.format("function %s function %s", sigAlg, helpSigAlg);
        signatureGeneratorFunction = StringUtils.substringBetween(signatureGeneratorAlgorithm, "function", "(").trim();
    }