github.com/varialus/godfly@v0.0.0-20130904042352-1934f9f095ab/src/pkg/crypto/sha1/example_test.go (about)

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package sha1_test
     6  
     7  import (
     8  	"crypto/sha1"
     9  	"fmt"
    10  	"io"
    11  )
    12  
    13  func ExampleNew() {
    14  	h := sha1.New()
    15  	io.WriteString(h, "His money is twice tainted: 'taint yours and 'taint mine.")
    16  	fmt.Printf("% x", h.Sum(nil))
    17  	// Output: 59 7f 6a 54 00 10 f9 4c 15 d7 18 06 a9 9a 2c 87 10 e7 47 bd
    18  }