sha256

sha256 参考

package main

import (
	"crypto/sha256"
	"fmt"
)

func main() {
	h := sha256.New()
	h.Write([]byte("hello world\n"))
	fmt.Printf("%x", h.Sum(nil))
}

结果:

a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447
posted @ 2020-11-11 19:04  TR_Goldfish  阅读(48)  评论(0编辑  收藏  举报