I have an arbitrary byte
in Python that I want to cast into a 64 bit integer and back into the same byte.
I am currently, using this to turn the bytes
into an int
, where x
is a byte I am given:
int.from_bytes(x, "little")
But I'm struggling on how to use int.to_byte()
to convert it back to the same bytes because I'm unsure what to put for length, nothing seems to create the equivalent byte?
没有评论:
发表评论