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.
5 // Package hash provides interfaces for hash functions.
10 // Hash is the common interface implemented by all hash functions.
12 // Write adds more data to the running hash.
13 // It never returns an error.
16 // Sum appends the current hash to b and returns the resulting slice.
17 // It does not change the underlying hash state.
20 // Reset resets the hash to one with zero bytes written.
23 // Size returns the number of bytes Sum will return.
26 // BlockSize returns the hash's underlying block size.
27 // The Write method must be able to accept any amount
28 // of data, but it may operate more efficiently if all writes
29 // are a multiple of the block size.
33 // Hash32 is the common interface implemented by all 32-bit hash functions.
34 type Hash32
interface {
39 // Hash64 is the common interface implemented by all 64-bit hash functions.
40 type Hash64
interface {