public static String compress(final String srcTxt) {
        return Unchecked.supplier(() -> {
            val bytes = compress(srcTxt.getBytes(StandardCharsets.UTF_8));
            val base64 = StringUtils.remove(EncodingUtils.encodeBase64(bytes), '\0');
            return new String(StandardCharsets.UTF_8.encode(base64).array(), StandardCharsets.UTF_8);
        }).get();
    }
Use {@link java.util.zip.ZipOutputStream} to zip text to byte array, then convert
byte array to base64 string, so it can be transferred via http request.

@param srcTxt the src txt
@return the string in UTF-8 format and base64'ed, or null.
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CompressionUtils.java