ber.py 文件源码

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

项目:RemoteTree 作者: deNULL 项目源码 文件源码
def encode(self, x):
        if type(x) is bool:
            if x:
                self.encode_tlv(1, max_byte)
            else:
                self.encode_tlv(1, zero_byte)
        elif (type(x) is int) or (type(x) is long):
            self.encode_tlv(2, paramiko.util.deflate_long(x))
        elif type(x) is str:
            self.encode_tlv(4, x)
        elif (type(x) is list) or (type(x) is tuple):
            self.encode_tlv(0x30, self.encode_sequence(x))
        else:
            raise BERException('Unknown type for encoding: %s' % repr(type(x)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号