代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
GO
】
通过zlib压缩数据
作者:
heishui
/ 发布于
2014/8/12
/
698
package main import ( "fmt" "compress/zlib" "bytes" ) func main() { var input = []byte("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAAAgCAYAAABtn4gCAAAI9klEQVR4Xu2cfYxcVRmHn3Pu3Nm6lXa2ta0AYlsgFSGgThMU0W5hGkqApNGARk3cGm3BRN3FYGuCISrBXaNphcSkG2I3hn9gY2gSNWq32AoE1C6KRihFti2QSgvsTmm783HvOa+zM69cSS8Tacsq7n2SX87cj5P7ZvLs2ztnbseICG8HMjIsbxMyMnIoxhja8fJnriuYMNdjOsIVNhd0Y0wBRbxH6nHZ16OdUot2iXNDC3/2mzJtOImOnpHJ2p4Xr13ZkDTYJLHrwRgw4L1gAptIFzt87AoSuzXi/BqJ3KZ/XL1iSGLXd9aOh8u81WRksh5cefmUeFuBgmBABHEeEziwBrUVvCCxayWaSow419MY17zw4eVrz3ls9zbeKjIyWV+4bPkmiVyvCtnqps6Bta2uahJZxQs4jziHxP7fxS1I7B947tJLN5/7xBN9tIeN37yNN0EXME6LecAEGfR/746ZJeuBSy9RUVsiGucxsYPAYuxUzOtlFQEniG8JS+xRaTW+d/+y97P46Sf7yMg4XbLuPW/ZGuqu1+cE4y0m8OAs0uyopjmqqArJrYDz4FVU1wrJ6959S5ftWjL29DZOlYxM1ut/eU3h7tEjW2/+yWE683kIPBJYTGzBGkwjaFdVXRFIZPXSktWJ3hbotheUrQ1hdzaELXMqZGSyCmzaV5xT+PNDR/jg3hqzcjmM9aCSij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JItoY1U8jlbSKsdlgXCT1dBwmjkFrN4p3BxQFxs6NOxZadM2uXfT77f1cZp/kDVhrL7+wuGMOmIGd6cqEhaMSqrBfnKtw6/yAWdHnKEEe2ETP1esgLfRd9cU95Wn6RJSOTVeFD31lRMJYea80KY2n+fNAd817i3FyMCIinLMJO780u8QxdcvNTp//ngzIyWU8jGRnZrwhmZPwT5I+Pd2qC5IkAAAAASUVORK5CYII") var buf bytes.Buffer compressor, err := zlib.NewWriterLevelDict(&buf, zlib.BestCompression, input) if err != nil { fmt.Println("压缩失败") return } compressor.Write(input) compressor.Close() fmt.Println(buf.Bytes()) fmt.Println(len(buf.Bytes())) fmt.Println(len(input)) }
试试其它关键字
zlib
压缩数据
同语言下
.
将SQL查询结果转换成map数组
.
德州扑克的核心规则算法
.
格式化时间
.
超简单QR二维码生成器
.
检查命令位置,替代 mac 下 whereis
.
百度 API 翻译工具
.
鼠标事件处理
.
快速排序
.
鸡尾酒排序
.
冒泡排序
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
heishui
贡献的其它代码
(
23
)
.
map字典使用
.
搭建最简单的文件浏览web服务器
.
单个文件拷贝
.
写入字符串到文件
.
冒泡法排序
.
for当做while用法
.
计算指定年月的天数
.
扫描目录并获取相关信息
.
获取本机逻辑CPU的数量
.
AES加密
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3