14 lines
296 B
Python
Raw Normal View History

2023-08-17 19:51:00 +08:00
import _struct
2023-08-17 21:55:23 +08:00
def pack(fmt: str, *args) -> bytes:
2023-08-17 19:51:00 +08:00
return _struct.pack(fmt, *args)
2023-08-17 21:55:23 +08:00
def unpack(fmt: str, data: bytes, offset=0) -> tuple:
return _struct.unpack(fmt, data, offset)
def unpack_from(fmt: str, data: bytes, offset=0) -> tuple:
return _struct.unpack(fmt, data, offset)