Skip to content

Instantly share code, notes, and snippets.

@maruno
Created December 16, 2023 15:22
Show Gist options
  • Save maruno/ff9c0d1b36c4f95090be07b4568ab9b4 to your computer and use it in GitHub Desktop.
Save maruno/ff9c0d1b36c4f95090be07b4568ab9b4 to your computer and use it in GitHub Desktop.
IV-17 charset creation
def create_char(segments):
char_1 = 0
char_2 = 0
for segment in segments:
if 3 <= segment <= 9:
char_1 |= (1 << (segment - 3))
elif segment == 13:
char_1 |= (1 << 7)
if 14 <= segment <= 21:
char_2 |= (1 << (segment - 14))
return hex(char_1), hex(char_2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment