Created
May 24, 2018 01:44
-
-
Save Fhernd/a345f299c98961c0b9ff50f468f3a60c to your computer and use it in GitHub Desktop.
Representación de una cadena de bytes como un entero grande. OrtizOL.
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
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