Class Base91

java.lang.Object
no.polaric.core.util.Base91

public class Base91 extends Object
APRS Base91 encoding/decoding implementation. APRS Base91 (basE91) is an encoding method used in APRS (Automatic Packet Reporting System) for encoding binary data as ASCII text. It uses 91 consecutive ASCII characters from '!' (ASCII 33) to '{' (ASCII 123). This implementation uses the basE91 streaming algorithm which encodes binary data efficiently using variable-length encoding with a bit queue. It processes 13 bits at a time, encoding them as two base-91 characters. This encoding is used in APRS for compressed position data, telemetry, and other binary data that needs efficient ASCII representation. Compatible with the basE91 specification and APRS requirements. See also: https://github.com/maqifrnswa/Simple-Base91
  • Constructor Details

    • Base91

      public Base91()
  • Method Details

    • encode

      public static String encode(byte[] input)
      Encode binary data to APRS Base91 string. Uses the basE91 streaming algorithm which processes input bytes through a bit queue. When enough bits are accumulated (>12), it extracts 13 bits and encodes them as two base-91 characters. This provides efficient variable-length encoding of binary data.
      Parameters:
      input - The binary data to encode
      Returns:
      APRS Base91 encoded string
    • decode

      public static byte[] decode(String input)
      Decode APRS Base91 string to binary data. Uses the basE91 streaming algorithm to decode. Processes characters in pairs, converting each pair back to 13 bits of data. Handles final odd character by decoding it as 6 bits.
      Parameters:
      input - The APRS Base91 encoded string
      Returns:
      Decoded binary data