protected ByteSource combine(ByteSource privateSalt, ByteSource publicSalt) {

            // optional 'pepper'
            byte[] privateSaltBytes = privateSalt != null ? privateSalt.getBytes() : null;
            int privateSaltLength = privateSaltBytes != null ? privateSaltBytes.length : 0;

            // salt must always be present.
            byte[] publicSaltBytes = publicSalt.getBytes();
            int extraBytesLength = publicSaltBytes.length;

            int length = privateSaltLength + extraBytesLength;

            if (length <= 0) {
                return SimpleByteSource.empty();
            }

            byte[] combined = new byte[length];

            int i = 0;
            for (int j = 0; j < privateSaltLength; j++) {
                combined[i++] = privateSaltBytes[j];
            }
            for (int j = 0; j < extraBytesLength; j++) {
                combined[i++] = publicSaltBytes[j];
            }

            return ByteSource.Util.bytes(combined);
        }
Combines the specified 'private' salt bytes with the specified additional extra bytes to use as the
total salt during hash computation.  {@code privateSaltBytes} will be {@code null} }if no private salt has been
configured.

@param privateSalt the (possibly {@code null}) 'private' salt to combine with the specified extra bytes
@param publicSalt  the extra bytes to use in addition to the given private salt.
@return a combination of the specified private salt bytes and extra bytes that will be used as the total
salt during hash computation.
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/SimpleHashProvider.java