Files
trx-rs/external/ft8_lib/utils/convert_generator.py
T
sjg 1199ab85e9 [feat](trx-rs): add ft8 decoder
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:19:56 +01:00

17 lines
332 B
Python

import sys
import re
rx1 = re.compile(r'"([0-9a-z]+)"', re.I)
for line in sys.stdin:
line = line.strip()
m = rx1.search(line)
if m == None:
continue
line = m.group(1)
if len(line) % 2 == 1:
line += '0'
b = ['0x' + line[i*2:i*2+2] for i in range(len(line)/2)]
print '{ %s },' % (', '.join(b))