- 十六进制的编码和解码
s = b'hello'import binasciih = binascii.b2a_hex(s)print(h)print(binascii.a2b_hex(h))import base64h = base64.b16encode(s)print(h)print(base64.b16decode(h))
b'68656c6c6f'b'hello'b'68656C6C6F'b'hello'
本文共 258 字,大约阅读时间需要 1 分钟。
s = b'hello'import binasciih = binascii.b2a_hex(s)print(h)print(binascii.a2b_hex(h))import base64h = base64.b16encode(s)print(h)print(base64.b16decode(h))
b'68656c6c6f'b'hello'b'68656C6C6F'b'hello'
转载于:https://www.cnblogs.com/4thing/p/5719749.html