go sha1

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/CosmopolitanMe/article/details/88677683
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

猜你喜欢

转载自blog.csdn.net/CosmopolitanMe/article/details/88677683