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