@Override
    public String format(final Hash hash) {
        requireNonNull(hash, "hash in Shiro2CryptFormat.format(Hash hash)");

        if (!(hash instanceof AbstractCryptHash)) {
            throw new UnsupportedOperationException("Shiro2CryptFormat can only format classes extending AbstractCryptHash.");
        }

        AbstractCryptHash cryptHash = (AbstractCryptHash) hash;
        return TOKEN_DELIMITER + ID + cryptHash.formatToCryptString();
    }
Converts a Hash-extending class to a string understood by the hash class. Usually this string will follow
posix standards for passwords stored in {@code /etc/passwd}.

<p>This method should only delegate to the corresponding formatter and prepend {@code $shiro2$}.</p>

@param hash the hash instance to format into a String.
@return a string representing the hash.
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/format/Shiro2CryptFormat.java