@Override
    protected String convertBytesToString(final byte[] random) {
        val output = new char[random.length];
        IntStream.range(0, random.length).forEach(i -> {
            val printableCharacters = getPrintableCharacters();
            val index = Math.abs(random[i] % printableCharacters.length);
            output[i] = printableCharacters[index];
        });
        return new String(output);
    }
Convert bytes to string, taking into account {@link #PRINTABLE_CHARACTERS}.

@param random the random
@return the string
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/gen/DefaultRandomStringGenerator.java