One common cryptographic hash function is known as SHA-1. Here's how it is used:
package main //from w w w .jav a 2s.co m import ( "fmt" "crypto/sha1" ) func main() { h := sha1.New() h.Write([]byte("test")) bs := h.Sum([]byte{}) fmt.Println(bs) }