python中的binascii
簡單使用binascii
import binascii
a = '中文或其他'.encode() # 轉為bytes.
print(a)
a1 = binascii.b2a_hex(a) # 轉為不帶\x的16進位制資料.
print(a1)
a2 = binascii.a2b_hex(a1) # 將a1轉換為帶\x的16進位制資料.
print(a2)
相關文章
- Python處理十六進位制與二進位制轉換的問題——binascii自帶庫PythonASCII
- Python 中的類(中)Python
- Python中的字串Python字串
- python 中的序列Python
- python中的tracebackPython
- python 中的[::-1]Python
- Python中的tuplePython
- Python中的dictPython
- python中的風險Python
- Python中的字典Python
- python中的 += 與 +Python
- Python中的methodPython
- Python中的ClassPython
- python(python中的super函式、)Python函式
- Python中的類和物件(中級)Python物件
- Python中列表的方法Python
- Python中的多程式Python
- python中return的用法Python
- Python中的Unittest框架Python框架
- python中的註釋Python
- python中*args的使用Python
- python中的列表操作Python
- Python中的abc模組Python
- python中的chardet模組Python
- python中cryptodome的DESPython
- python中cryptodome的AESPython
- python中rsa的RSAPython
- 06 - Python 中的字串Python字串
- python中for……else……的使用Python
- Python中的正則Python
- python中的過載Python
- Python中的互斥鎖Python
- python 中assert的使用Python
- python中的__call__Python
- 06 – Python 中的字串Python字串
- python類中的方法Python
- python 中 is, is not ,==, != 的區別Python
- python中的pickle功能Python