public static String encodeBase32(String data) {
        byte[] bytes = data == null ? null : data.getBytes(StandardCharsets.UTF_8);
        return encodeBase32(bytes);
    }
Encodes a String as a base32 String using the base32hex profile.

@param data a String to encode.
@return a base32 encoded String.
xmppserver/src/main/java/org/jivesoftware/util/StringUtils.java