pack.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:endosome 作者: teor2345 项目源码 文件源码
def split_field(byte_len, data_bytes):
    '''
    Return a tuple containing the first byte_len bytes in data_bytes, and the
    remainder of data_bytes.
    Asserts if data_bytes is not at least byte_len bytes long.
    '''
    assert len(data_bytes) >= byte_len
    return (bytearray(data_bytes[0:byte_len]),
            bytearray(data_bytes[byte_len:]))

# struct formats. See
# https://docs.python.org/2/library/struct.html#byte-order-size-and-alignment
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号