Skip to content

Instantly share code, notes, and snippets.

@hdevalence
Created October 30, 2016 17:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdevalence/aac098857248a1c3134eb8101b692547 to your computer and use it in GitHub Desktop.
Save hdevalence/aac098857248a1c3134eb8101b692547 to your computer and use it in GitHub Desktop.
convert sage integers to little endian byte strings
# 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