Created
December 16, 2023 15:22
-
-
Save maruno/ff9c0d1b36c4f95090be07b4568ab9b4 to your computer and use it in GitHub Desktop.
IV-17 charset creation
This file contains hidden or 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
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