import "crypto/sha1"
import "fmt"
func main(){
s:="this is a string"
h:=sha1.New()
h.Write([]byte(s))
bs:=h.Sum(nil)
fmt.Println(bs)
fmt.Printf("%x\n",bs)
}
output:
[81 117 146 223 143 236 58 209 70 167 154 154 241 83 219 42 77 120 78 197]
517592df8fec3ad146a79a9af153db2a4d784ec5
go sha1
最新推荐文章于 2025-09-11 15:00:00 发布
此博客围绕Go语言中的SHA1算法展开,虽内容缺失,但可推测会涉及该算法在Go语言里的应用、实现等信息技术相关内容。
173

被折叠的 条评论
为什么被折叠?



