python字符串str与hex转换

本文共有320个字,关键词:

问题:python str to hex

方法:

str to hex

hex_str = binascii.hexlify(str.encode('utf-8')).decode('utf-8')

hex to str

str = binascii.unhexlify(hex_str.encode('utf-8')).decode('utf-8')

参考:

https://blog.csdn.net/weixin_42902669/article/details/90754498
版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。
添加新评论
暂无评论