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

Function decode_int32

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

Decode a 4-byte string into a 32-bit signed integer @param data: byte array of size 4 that represents the integer @param return: decoded integer

(data)

Source from the content-addressed store, hash-verified

40
41
42def decode_int32(data):
43 """
44 Decode a 4-byte string into a 32-bit signed integer
45 @param data: byte array of size 4 that represents the integer
46 @param return: decoded integer
47 """
48 if isinstance(data, bytearray):
49 data = array.array('B', data)
50 return struct.unpack('<i', data)[0]
51
52
53def encode_int16(number):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected