@Override
    public HashFormat getInstance(String in) {
        if (in == null) {
            return null;
        }

        HashFormat hashFormat = null;
        Class<?> clazz = null;

        //NOTE: this code block occurs BEFORE calling getHashFormatClass(in) on purpose as a performance
        //optimization.  If the input arg is an MCF-formatted string, there will be many unnecessary ClassLoader
        //misses which can be slow.  By checking the MCF-formatted option, we can significantly improve performance
        if (in.startsWith(ModularCryptFormat.TOKEN_DELIMITER)) {
            //odds are high that the input argument is not a fully qualified class name or a format key (e.g. 'hex',
            //base64' or 'shiro1').  Try to find the key and lookup via that:
            String test = in.substring(ModularCryptFormat.TOKEN_DELIMITER.length());
            String[] tokens = test.split("\\" + ModularCryptFormat.TOKEN_DELIMITER);
            //the MCF ID is always the first token in the delimited string:
            String possibleMcfId = tokens.length > 0 ? tokens[0] : null;
            if (possibleMcfId != null) {
                //found a possible MCF ID - test it using our heuristics to see if we can find a corresponding class:
                clazz = getHashFormatClass(possibleMcfId);
            }
        }

        if (clazz == null) {
            //not an MCF-formatted string - use the unaltered input arg and go through our heuristics:
            clazz = getHashFormatClass(in);
        }

        if (clazz != null) {
            //we found a HashFormat class - instantiate it:
            hashFormat = newHashFormatInstance(clazz);
        }

        return hashFormat;
    }
Sets a set of package names that can be searched for {@link HashFormat} implementations according to
heuristics defined in the {@link #getHashFormatClass(String, String) getHashFormat(packageName, token)} JavaDoc.
<h3>Efficiency</h3>
Configuring this property is not as efficient as configuring a {@link #getFormatClassNames() formatClassNames}
map, but it may be more convenient depending on the number of {@code HashFormat} implementations that
need to be supported by this factory.

@param searchPackages a set of package names that can be searched for {@link HashFormat} implementations
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.java