Getting modulo of bytes-number in Python -


when working in python, let's have long bytes object. want modulo number. example, have bytes object b'hi' , want modulo 3, result 26729 % 3 == 2. (the bytes object seen 1 big number.)

how do in python? (preferably python 3.) i'm hoping there's relatively elegant way don't have manually compute number.

>>> int.from_bytes(b'hi', 'big', signed=false) % 3 2 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -