Skip to content

Instantly share code, notes, and snippets.

@rgerganov
Created July 30, 2021 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgerganov/4fb82dffc2720c331e1eb03745e47a92 to your computer and use it in GitHub Desktop.
Save rgerganov/4fb82dffc2720c331e1eb03745e47a92 to your computer and use it in GitHub Desktop.
APRS passcode generator
#!/usr/bin/env python3
import sys
if __name__ == '__main__':
callsign = sys.argv[1].upper()
print(callsign)
hash = 0x73e2
for i in range(0, len(callsign), 2):
hash ^= ord(callsign[i]) << 8
if i + 1 < len(callsign):
hash ^= ord(callsign[i+1])
print(hash & 0x7fff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment