Advertisement
Fhernd

cadena-bytes-entero.py

May 23rd, 2018
2,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. cadena_bytes = b'\x00\x124V\x00x\x90\xab\x00\xcd\xef\x01\x00#\x004'
  2.  
  3. print(len(cadena_bytes))
  4.  
  5. print(int.from_bytes(cadena_bytes, 'little'))
  6. print(int.from_bytes(cadena_bytes, 'big'))
  7.  
  8. print('')
  9.  
  10. numero = 94522842520747284487117727783387188
  11. print(numero.to_bytes(16, 'big'))
  12. print(numero.to_bytes(16, 'little'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement