github.com/waltonchain/waltonchain_gwtc_src@v1.1.4-0.20201225072101-8a298c95a819/crypto/hash/hash.go (about)

     1  // Use of this source code is governed by an ISC
     2  // license that can be found in the LICENSE file.
     3  
     4  package hash
     5  
     6  import "io"
     7  
     8  type Hash interface {
     9  	// Write (via the embedded io.Writer interface) adds more
    10  	// data to the running hash. It never returns an error.
    11  	io.Writer
    12  
    13  	// Reset resets the Hash to its initial state.
    14  	Reset()
    15  
    16  	// Sum appends the current hash to dst and returns the result
    17  	// as a slice. It does not change the underlying hash state.
    18  	Sum(dst []byte) []byte
    19  
    20  	// Size returns the number of bytes Sum will return.
    21  	Size() int
    22  
    23  	// BlockSize returns the hash's underlying block size.
    24  	// The Write method must be able to accept any amount
    25  	// of data, but it may operate more efficiently if
    26  	// all writes are a multiple of the block size.
    27  	BlockSize() int
    28  }