Skip to content

Conversation

@zaneChou1
Copy link
Contributor

Working in the process for writing 'golang-encoding-algorithm-analysis' article. At present, the analysis of ascii85, base32, base64, hex, and binary algorithms has been completed.

@zaneChou1 zaneChou1 changed the title [WIP] Add golang-encoding-algorithm-analysis.md Add golang-encoding-algorithm-analysis.md Aug 13, 2020

### 概述

golang编解码库实现了ascii85\base32\base64\hex\binary\asn1\xml\json\gob\csv\pem等11种编解码算法用于数据处理,这11个编解码包各自实现了数据与byte数组和文本形式相互转换的接口。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉没理解什么是以及为什么要用编码算法,能否写一段内容描述下什么是编码算法,用在什么地方(场景)


ASCII85:包含85个可打印ASCII字符,使用5个ascii字符编码4个字节。对应到ASCII编码表,可见字符包括33(“!”)到117(“u”)。

算法核心代码如下,每次处理4个字节的二进制数据,然后对4字节的数据进行5次除以85取余数操作,余数+“!”得到编码后的ascii字符。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最好能多加一些图来展示,直接上代码,像我这样不懂原理感觉比较枯燥难懂

@zaneChou1 zaneChou1 force-pushed the Encoding-Algorithm-Analysis branch from 048ba33 to 31e01d5 Compare September 23, 2020 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants