Skip to content

Commit

Permalink
digest: remove last of deprecated methods
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen J Day <stephen.day@docker.com>
  • Loading branch information
stevvooe committed Dec 17, 2016
1 parent 5bb1f32 commit 2616283
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ out when using this package.

The Go API, at this stage, is considered stable, unless otherwise noted.

Right now, only two methods are marked as "deprecated", which may be
removed before wider deployment.

As always, before using a package export, read the [godoc](https://godoc.org/github.com/docker/go-digest).

# Contributing
Expand Down
9 changes: 2 additions & 7 deletions algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ func (a Algorithm) Digester() Digester {
}
}

// New is deprecated. Use Algorithm.Digester.
func (a Algorithm) New() Digester {
return a.Digester()
}

// Hash returns a new hash as used by the algorithm. If not available, the
// method will panic. Check Algorithm.Available() before calling.
func (a Algorithm) Hash() hash.Hash {
Expand All @@ -118,7 +113,7 @@ func (a Algorithm) Hash() hash.Hash {

// FromReader returns the digest of the reader using the algorithm.
func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {
digester := a.New()
digester := a.Digester()

if _, err := io.Copy(digester.Hash(), rd); err != nil {
return "", err
Expand All @@ -129,7 +124,7 @@ func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {

// FromBytes digests the input and returns a Digest.
func (a Algorithm) FromBytes(p []byte) Digest {
digester := a.New()
digester := a.Digester()

if _, err := digester.Hash().Write(p); err != nil {
// Writes to a Hash should never fail. None of the existing
Expand Down

0 comments on commit 2616283

Please sign in to comment.