scapy.compat¶
Python2和3链接类。
-
scapy.compat.
base64_bytes
(x)¶ 将base64转换为字节
-
scapy.compat.
bytes_base64
(x)¶ 将字节转换为base64
-
scapy.compat.
bytes_encode
(x)¶ 确保给定的对象是字节。如果参数是一个包,则首选raw()。
-
scapy.compat.
bytes_hex
(x)¶ 将str或bytes对象十六进制化
-
scapy.compat.
chb
(x)¶ 与chr()相同,但编码为字节。
-
scapy.compat.
hex_bytes
(x)¶ 将str或byte对象反六边形
-
scapy.compat.
lambda_tuple_converter
(func)¶ - 将Python 2函数转换为
λ(x,y):x+y
- 在Python 3格式中:
λx,y:x+y
-
scapy.compat.
orb
(x)¶ 当不是int时返回ord(x)。
-
scapy.compat.
plain_str
(x)¶ 将基本字节对象转换为str
-
scapy.compat.
raw
(x)¶ 生成数据包并返回其字节表示形式。此函数始终是跨版本兼容的