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