private static MessageDigest getMessageDigestInstance(final String alg) throws Exception {
        val digest = MessageDigest.getInstance(alg);
        digest.reset();
        return digest;
    }
Abbreviate string.

@param str      the str
@param maxWidth the max width; negative/zero values disable abbreviation
@return the string
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java