diff options
| author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
|---|---|---|
| committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
| commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
| tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/crypto/sha1/example_test.go | |
| parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
| download | golang-51f2ca399fb8da86b2e7b3a0582e083fab731a98.tar.gz | |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/pkg/crypto/sha1/example_test.go')
| -rw-r--r-- | src/pkg/crypto/sha1/example_test.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pkg/crypto/sha1/example_test.go b/src/pkg/crypto/sha1/example_test.go index 25fe5f308..42aec8afa 100644 --- a/src/pkg/crypto/sha1/example_test.go +++ b/src/pkg/crypto/sha1/example_test.go @@ -12,7 +12,14 @@ import ( func ExampleNew() { h := sha1.New() - io.WriteString(h, "His money is twice tainted: 'taint yours and 'taint mine.") + io.WriteString(h, "His money is twice tainted:") + io.WriteString(h, " 'taint yours and 'taint mine.") fmt.Printf("% x", h.Sum(nil)) // Output: 59 7f 6a 54 00 10 f9 4c 15 d7 18 06 a9 9a 2c 87 10 e7 47 bd } + +func ExampleSum() { + data := []byte("This page intentionally left blank.") + fmt.Printf("% x", sha1.Sum(data)) + // Output: af 06 49 23 bb f2 30 15 96 aa c4 c2 73 ba 32 17 8e bc 4a 96 +} |
