当前位置:网站首页>Binassii module - converting between binary and ASCII
Binassii module - converting between binary and ASCII
2022-06-12 10:25:00 【Free gift, juvenile】
binascii Modules contain many in binary and various ASCII A method of converting between encoded binary representations .
link :Python Chinese document - binascii — In binary and ASCII Between | Docs4dev
- binascii.a2b_uu( * string *)
Single line uuencoded Data is converted back to binary and binary data is returned . Except for the last line , Lines usually contain 45 individual ( Binary system ) byte . A row of data can be followed by a space .
- binascii.b2a_uu( * data *, **, *backtick=False * )
Convert binary data to one line ASCII character , The return value is the converted row , Include line breaks . * data The maximum length of is 45. If backtick * by true, Then zero by '`' Instead of spaces .
- binascii.a2b_base64( * string * )
take base64 The data block is converted back to binary and returns binary data . More than one line at a time .
- binascii.b2a_base64( * data *, **, *newline=True * )
Use base64 Encoding converts binary data into one line ASCII character . The return value is the converted row , If * newline * by true, Include line breaks . The output of this function conforms to RFC 3548.
- binascii.crc_hqx(* data, value *)
Calculation * data Of 16 position CRC value , from value Start as initial CRC, And then return the result . This use CRC-CCITT polynomial x*16*x*12*x*51, Usually expressed as 0x1021. this CRC With binhex4 Format use .
- binascii.crc32(* data *[, *value *])
from * value Initial CRC Start , Calculation data * Of 32 Bit checksums CRC-32. Default initial CRC zero . This algorithm is similar to ZIP File checksum is consistent . Since the algorithm is intended to be used as a checksum algorithm , Therefore, it is not suitable to be used as a conventional hash algorithm . Usage is as follows :
print(binascii.crc32(b"hello world"))
# Or, in two pieces:
crc = binascii.crc32(b"hello")
crc = binascii.crc32(b" world", crc)
print('crc32 = {:#010x}'.format(crc))边栏推荐
- Chromebook system without anti-virus software
- [CEGUI] font loading optimization
- 【MySQL】sql_ Model mode
- How high can C language reach by self-study alone?
- properties中文乱码
- The difference between static method locking and non static method locking
- 在一个“去QA化”的项目中,QA能做什么?
- Redis (I) Internal data structure
- 2021-03-26
- 【ParquetEncodingException: empty fields are illegal, the field should be ommited completely instead
猜你喜欢

2022京东618预售定金怎么退?京东618定金能退吗?
![[CEGUI] concept introduction](/img/a6/695d7f1a4e57c8438e2d1a4cad11dc.jpg)
[CEGUI] concept introduction

Raw socket usage

Global and local existence of array, integer and character variables

Tp6 debugging (trace)

2022 JD 618 Comment rembourser le dépôt de pré - vente? Le dépôt JD 618 peut - il être remboursé?
![[MySQL] index invalidation and index optimization](/img/af/9ed540aab764f4962ccc9bbfe406f3.jpg)
[MySQL] index invalidation and index optimization

2022淘宝618超级喵运会怎么玩?2022淘宝618喵运会玩法技巧

First NFT platform in dfinity Ecology: impossible thoughts

Getting started with cloud API basics -- basic knowledge of picgo writing plug-ins
随机推荐
Add jar package under idea2018 web project
2022京東618預售定金怎麼退?京東618定金能退嗎?
Get array median
Getting started with cloud API basics -- basic knowledge of picgo writing plug-ins
在一个“去QA化”的项目中,QA能做什么?
Download Notepad++
Golang start service background daemon
properties中文乱码
93. 獲得內網的所有IP地址
Chromebook system without anti-virus software
Php:redis uses geospatial
PHP: Excel to get the letter header
Simple use of autojs
机器学习不是你想用,想用就能用
How to play the 2022 Taobao 618 Super Cat Games? What are the strategies for the Super Cat Games
OpenCV中CLAHE用于16位图像增强显示
古董级MFC/GDI+框架LCD显示控件
[CEGUI] font loading optimization
PHP wechat red packet allocation logic
ServletContext object