Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python tobytes

# for decimal to bytes
one_byte_little_endian = (10).to_bytes(1,"little")
two_byte_big_endian = (512).to_bytes(2,"big")
                    
# for hexadecimal to bytes
one_byte_little_endian = (0x0a).to_bytes(1,"little")
two_byte_big_endian = (0x0102).to_bytes(2,"big")
 
PREVIOUS NEXT
Tagged: #python #tobytes
ADD COMMENT
Topic
Name
6+5 =