You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
783 B

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