Skip to main content

Documentation Index

Fetch the complete documentation index at: https://waasapi.uuwallet.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Base64Util is a core encoding/decoding tool in encrypted communication, primarily implementing mutual conversion between binary data and Base64 text. In API communication, Base64 encoding ensures encrypted binary data can be safely transmitted via HTTP protocol.

Code Examples

import java.util.Base64;

public class Base64Util {
  /**
      * Encodes byte array to Base64 string
      *
      * @param bytes Original binary data
      * @return Base64 encoded string
      *
      * Usage scenario: Convert encrypted binary data to safely transmittable text format,
      *                suitable for HTTP request parameter encapsulation.
      */
      public static String encodeByte(byte[] bytes) {
          return Base64.getEncoder().encodeToString(bytes);
      }
      /**
      * Decodes Base64 string to byte array
      *
      * @param str Base64 encoded string
      * @return Decoded original binary data
      *
      * Usage scenario: Convert Base64 data from API responses to binary,
      *                preparing for subsequent decryption operations.
      */
      public static byte[] decodeString(String str) {
          return Base64.getDecoder().decode(str);
      }
  }