protected final HashFormat newHashFormatInstance(Class clazz) {
        assertHashFormatImpl(clazz);
        return (HashFormat) ClassUtils.newInstance(clazz);
    }
Heuristically determine the fully qualified {@code HashFormat} implementation class name in the specified
package based on the provided token.
<p/>
The token is expected to be a relevant fragment of an unqualified class name in the specified package.
A 'relevant fragment' can be one of the following:
<ul>
<li>The {@code HashFormat} implementation unqualified class name</li>
<li>The prefix of an unqualified class name ending with the text {@code Format}.  The first character of
this prefix can be upper or lower case and both options will be tried.</li>
<li>The prefix of an unqualified class name ending with the text {@code HashFormat}.  The first character of
this prefix can be upper or lower case and both options will be tried.</li>
<li>The prefix of an unqualified class name ending with the text {@code CryptoFormat}.  The first character
of this prefix can be upper or lower case and both options will be tried.</li>
</ul>
<p/>
Some examples:
<table>
<tr>
<th>Package Name</th>
<th>Token</th>
<th>Expected Output Class</th>
<th>Notes</th>
</tr>
<tr>
<td>{@code com.foo.whatever}</td>
<td>{@code MyBarFormat}</td>
<td>{@code com.foo.whatever.MyBarFormat}</td>
<td>Token is a complete unqualified class name</td>
</tr>
<tr>
<td>{@code com.foo.whatever}</td>
<td>{@code Bar}</td>
<td>{@code com.foo.whatever.BarFormat} <em>or</em> {@code com.foo.whatever.BarHashFormat} <em>or</em>
{@code com.foo.whatever.BarCryptFormat}</td>
<td>The token is only part of the unqualified class name - i.e. all characters in front of the {@code *Format}
{@code *HashFormat} or {@code *CryptFormat} suffix.  Note that the {@code *Format} variant will be tried before
{@code *HashFormat} and then finally {@code *CryptFormat}</td>
</tr>
<tr>
<td>{@code com.foo.whatever}</td>
<td>{@code bar}</td>
<td>{@code com.foo.whatever.BarFormat} <em>or</em> {@code com.foo.whatever.BarHashFormat} <em>or</em>
{@code com.foo.whatever.BarCryptFormat}</td>
<td>Exact same output as the above {@code Bar} input example. (The token differs only by the first character)</td>
</tr>
</table>

@param packageName the package to search for matching {@code HashFormat} implementations.
@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