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

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

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

google shop client API returns 400 bad request error while adding an item -