1
0
mirror of https://github.com/golang/go synced 2024-09-25 01:20:13 -06:00

crypto/md5: add example for Sum

LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/64820044
This commit is contained in:
ChaiShushan 2014-02-17 14:33:00 +11:00 committed by Dave Cheney
parent 637e1f7da0
commit 2be94b1ba6

View File

@ -17,3 +17,9 @@ func ExampleNew() {
fmt.Printf("%x", h.Sum(nil)) fmt.Printf("%x", h.Sum(nil))
// Output: e2c569be17396eca2a2e3c11578123ed // Output: e2c569be17396eca2a2e3c11578123ed
} }
func ExampleSum() {
input := "The quick brown fox jumps over the lazy dog."
fmt.Printf("%x", md5.Sum([]byte(input)))
// Output: e4d909c290d0fb1ca068ffaddf22cbd0
}