Created
October 30, 2016 17:13
-
-
Save hdevalence/aac098857248a1c3134eb8101b692547 to your computer and use it in GitHub Desktop.
convert sage integers to little endian byte strings
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
# v--- endianness issues here | |
bytestr_to_arr = lambda s:"[" + ", ".join(['0x'+b+a for a,b in zip(s[0::2], s[1::2])]) + "]" | |
ZZtobytestr = lambda x: "".join(ZZ(x).digits(16, '0123456789abcdef')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment