Created
July 30, 2021 12:01
-
-
Save rgerganov/4fb82dffc2720c331e1eb03745e47a92 to your computer and use it in GitHub Desktop.
APRS passcode generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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