protected void checkValidSalt() {
        int length = salt.getBytes().length;
        if (length != getSaltLength()) {
            String message = String.format(
                    Locale.ENGLISH,
                    "Salt length is expected to be [%d] bytes, but was [%d] bytes.",
                    getSaltLength(),
                    length
            );
            throw new IllegalArgumentException(message);
        }
    }
Default check method for a valid salt. Can be overridden, because multiple salt lengths could be valid.
<p>
By default, this method checks if the number of bytes in the salt
are equal to the int returned by {@link #getSaltLength()}.

@throws IllegalArgumentException if the salt length does not match the returned value of {@link #getSaltLength()}.
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/AbstractCryptHash.java