Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created May 24, 2018 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/a345f299c98961c0b9ff50f468f3a60c to your computer and use it in GitHub Desktop.
Save Fhernd/a345f299c98961c0b9ff50f468f3a60c to your computer and use it in GitHub Desktop.
Representación de una cadena de bytes como un entero grande. OrtizOL.
cadena_bytes = b'\x00\x124V\x00x\x90\xab\x00\xcd\xef\x01\x00#\x004'
print(len(cadena_bytes))
print(int.from_bytes(cadena_bytes, 'little'))
print(int.from_bytes(cadena_bytes, 'big'))
print('')
numero = 94522842520747284487117727783387188
print(numero.to_bytes(16, 'big'))
print(numero.to_bytes(16, 'little'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment