package main
import (
"crypto/sha1"
"encoding/hex"
"fmt"
)
func main() {
s := "nilpointer.net"
h := sha1.New()
h.Write([]byte(s))
hash := hex.EncodeToString(h.Sum(nil))
fmt.Println(hash)
}
Output
b70c317d941cbefcd93aef04f08b1a876b1d4fb8