Skip to content

Instantly share code, notes, and snippets.

@jordan-chalupka
Created May 31, 2020 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordan-chalupka/4f2193df9ef12db70ded6eb4346eb6ae to your computer and use it in GitHub Desktop.
Save jordan-chalupka/4f2193df9ef12db70ded6eb4346eb6ae to your computer and use it in GitHub Desktop.
Using impl to create an implementation of the hash interface
func (Foo) Write(p []byte) (n int, err error) {
panic("not implemented") // TODO: Implement
}
// Sum appends the current hash to b and returns the resulting slice.
// It does not change the underlying hash state.
func (Foo) Sum(b []byte) []byte {
panic("not implemented") // TODO: Implement
}
// Reset resets the Hash to its initial state.
func (Foo) Reset() {
panic("not implemented") // TODO: Implement
}
// Size returns the number of bytes Sum will return.
func (Foo) Size() int {
panic("not implemented") // TODO: Implement
}
// BlockSize returns the hash's underlying block size.
// The Write method must be able to accept any amount
// of data, but it may operate more efficiently if all writes
// are a multiple of the block size.
func (Foo) BlockSize() int {
panic("not implemented") // TODO: Implement
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment