摘要:
先看实现代码: package main import ( "crypto/md5" "encoding/hex" "fmt" ) func main() { h := md5.New() h.Write([]byte("123456")) // 需要加密的字符串为 123456 cipherStr :... 阅读全文
posted @ 2015-01-28 16:41 蝈蝈俊 阅读(3168) 评论(0) 推荐(0)
|
|
摘要:
先看实现代码: package main import ( "crypto/md5" "encoding/hex" "fmt" ) func main() { h := md5.New() h.Write([]byte("123456")) // 需要加密的字符串为 123456 cipherStr :... 阅读全文
posted @ 2015-01-28 16:41 蝈蝈俊 阅读(3168) 评论(0) 推荐(0)
摘要:
先写一个公共函数, 比如在 common 包下有这么一个方法: // 写超时警告日志 通用方法func TimeoutWarning(tag, detailed string, start time.Time, timeLimit float64) { dis := time.Now().Sub(start).Seconds() if dis > timeLimit { ... 阅读全文
posted @ 2015-01-28 15:17 蝈蝈俊 阅读(3508) 评论(0) 推荐(0) |
|