aprs_is_passcode

Function aprs_is_passcode 

Source
pub fn aprs_is_passcode(callsign: &str) -> i32
Expand description

Compute the APRS-IS passcode from a callsign.

The algorithm is a simple hash of the callsign characters (without SSID). This is NOT cryptographic – it is a well-known public algorithm used by all APRS software.

§Algorithm

  1. Strip SSID (everything from - onward).
  2. Uppercase the base callsign.
  3. Starting with hash = 0x73E2, XOR each pair of bytes: first byte shifted left 8 bits, second byte as-is. If the callsign has an odd number of characters, the last byte is XOR’d shifted left 8 bits.
  4. Mask with 0x7FFF to produce a positive 15-bit value.