go语言使用crc32得到网络消息的校验码
2012-10-19 16:43
996 查看
package main import ( "fmt" "hash/crc32" "io") func main(){ //hash := crc32.NewIEEE() check_str := "Discard medicine more than two years old." //hash.write(check_str) //hash.Sum() ieee := crc32.NewIEEE() io.WriteString(ieee, check_str) s := ieee.Sum32() fmt.Println("IEEE(%s) = 0x%x",check_str,s) }
相关文章推荐
- GO语言学习:使用io.copyN实现网络文件传输
- go 语言使用ssh包连接操作Linux服务器,使用ping包查看服务器网络是否正常,使用cron包定时查询该服务器CPU使用情况
- 为什么要使用 Go 语言,Go 语言的优势在哪里?
- [原]在 go/golang语言中使用 google Protocol Buffer
- go语言使用go-sciter创建桌面应用(一) 简单的通过html,css写ui
- Android 原生应用开发得到Go语言支持
- go语言使用go-sciter创建桌面应用(四) 固定窗口大小
- Go语言:正则表达式的使用
- Go语言使用字符串的几个技巧分享
- go语言使用官方的 log package 来记录日志
- go语言中排序sort的使用方法示例
- GO语言LiteIDE的安装使用
- Go语言 IDE之Gogland配置使用
- Go语言中反射的正确使用
- 在Go语言中使用JSON
- 网络采集软件核心技术剖析系列(2)---如何使用C#语言获得任意站点博文的正文及标题
- golang实战使用gin+xorm搭建go语言web框架restgo详解5.4 控制器参数绑定
- Go 语言中Select与for结合使用时可能会遇到的坑
- 论go语言中goroutine的使用
- 一起talk C栗子吧(第九十八回:C语言实例--使用消息队列进行进程间通信二)