MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / encode_uint16

Function encode_uint16

src/ext/makerbot_driver/Encoder/Coding.py:62–68  ·  view source on GitHub ↗

Encode a 16-bit unsigned integer as a 2-byte string @param number @return byte array of size 2 that represents the integer

(number)

Source from the content-addressed store, hash-verified

60
61
62def encode_uint16(number):
63 """
64 Encode a 16-bit unsigned integer as a 2-byte string
65 @param number
66 @return byte array of size 2 that represents the integer
67 """
68 return struct.pack('<H', number)
69
70
71def decode_uint16(data):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected