Package no.polaric.core.util
Class Base91
java.lang.Object
no.polaric.core.util.Base91
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
Base91
public Base91()
-
-
Method Details
-
encode
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
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
-