wire_format.py 文件源码

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

项目:protoc-gen-lua-bin 作者: u0u0 项目源码 文件源码
def PackTag(field_number, wire_type):
  """Returns an unsigned 32-bit integer that encodes the field number and
  wire type information in standard protocol message wire format.

  Args:
    field_number: Expected to be an integer in the range [1, 1 << 29)
    wire_type: One of the WIRETYPE_* constants.
  """
  if not 0 <= wire_type <= _WIRETYPE_MAX:
    raise message.EncodeError('Unknown wire type: %d' % wire_type)
  return (field_number << TAG_TYPE_BITS) | wire_type
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号