summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/md5/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/crypto/md5/example_test.go')
-rw-r--r--src/pkg/crypto/md5/example_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pkg/crypto/md5/example_test.go b/src/pkg/crypto/md5/example_test.go
new file mode 100644
index 000000000..28be770a7
--- /dev/null
+++ b/src/pkg/crypto/md5/example_test.go
@@ -0,0 +1,19 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package md5_test
+
+import (
+ "crypto/md5"
+ "fmt"
+ "io"
+)
+
+func ExampleNew() {
+ h := md5.New()
+ io.WriteString(h, "The fog is getting thicker!")
+ io.WriteString(h, "And Leon's getting laaarger!")
+ fmt.Printf("%x", h.Sum(nil))
+ // Output: e2c569be17396eca2a2e3c11578123ed
+}