protected Class getHashFormatClass(String token) {

        Class clazz = null;

        //check to see if the token is a configured FQCN alias.  This is faster than searching packages,
        //so we try this first:
        if (this.formatClassNames != null) {
            String value = this.formatClassNames.get(token);
            if (value != null) {
                //found an alias - see if the value is a class:
                clazz = lookupHashFormatClass(value);
            }
        }

        //check to see if the token is one of Shiro's provided FQCN aliases (again, faster than searching):
        if (clazz == null) {
            ProvidedHashFormat provided = ProvidedHashFormat.byId(token);
            if (provided != null) {
                clazz = provided.getHashFormatClass();
            }
        }

        if (clazz == null) {
            //check to see if 'token' was a FQCN itself:
            clazz = lookupHashFormatClass(token);
        }

        if (clazz == null) {
            //token wasn't a FQCN or a FQCN alias - try searching in configured packages:
            if (this.searchPackages != null) {
                for (String packageName : this.searchPackages) {
                    clazz = getHashFormatClass(packageName, token);
                    if (clazz != null) {
                        //found it:
                        break;
                    }
                }
            }
        }

        if (clazz != null) {
            assertHashFormatImpl(clazz);
        }

        return clazz;
    }
Heuristically determine the fully qualified HashFormat implementation class name based on the specified
token.
<p/>
This implementation functions as follows (in order):
<ol>
<li>See if the argument can be used as a lookup key in the {@link #getFormatClassNames() formatClassNames}
map.  If a value (a fully qualified class name {@link HashFormat HashFormat} implementation) is found,
{@link ClassUtils#forName(String) lookup} the class and return it.</li>
<li>
Check to see if the token argument is a
{@link ProvidedHashFormat} enum value.  If so, acquire the corresponding {@code HashFormat} class and
return it.
</li>
<li>
Check to see if the token argument is itself a fully qualified class name.  If so, try to load the class
and return it.
</li>
<li>If the above options do not result in a discovered class, search all all configured
{@link #getSearchPackages() searchPackages} using heuristics defined in the
{@link #getHashFormatClass(String, String) getHashFormatClass(packageName, token)} method documentation
(relaying the {@code token} argument to that method for each configured package).
</li>
</ol>
<p/>
If a class is not discovered via any of the above means, {@code null} is returned to indicate the class
could not be found.

@param token the string token from which a class name will be heuristically determined.
@return the discovered HashFormat class implementation or {@code null} if no class could be heuristically determined.
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactory.java