1print((2**64).to_bytes(9, "little")) 2print((2**64).to_bytes(9, "big")) 3 4b = bytes(range(20)) 5 6il = int.from_bytes(b, "little") 7ib = int.from_bytes(b, "big") 8print(il) 9print(ib) 10print(il.to_bytes(20, "little")) 11print(ib.to_bytes(20, "big")) 12 13# check that extra zero bytes don't change the internal int value 14print(int.from_bytes(b + bytes(10), "little") == int.from_bytes(b, "little")) 15