Refactor specification of supported digests
To make the definition of supported digests more clear, we have refactored the digest package to have a special Algorithm type. This represents the digest's prefix and we associated various supported hash implementations through function calls. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
eee6cad2cf
commit
44da954565
14 changed files with 109 additions and 66 deletions
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
|
@ -86,7 +86,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/stevvooe/resumable",
|
||||
"Rev": "cf61dd331ceba0ab845444fdb626b9a465704e49"
|
||||
"Rev": "51ad44105773cafcbe91927f70ac68e1bf78f8b4"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/yvasiyarov/go-metrics",
|
||||
|
|
3
Godeps/_workspace/src/github.com/stevvooe/resumable/sha256/resume.go
generated
vendored
3
Godeps/_workspace/src/github.com/stevvooe/resumable/sha256/resume.go
generated
vendored
|
@ -3,6 +3,9 @@ package sha256
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/gob"
|
||||
|
||||
// import to ensure that our init function runs after the standard package
|
||||
_ "crypto/sha256"
|
||||
)
|
||||
|
||||
// Len returns the number of bytes which have been written to the digest.
|
||||
|
|
3
Godeps/_workspace/src/github.com/stevvooe/resumable/sha512/resume.go
generated
vendored
3
Godeps/_workspace/src/github.com/stevvooe/resumable/sha512/resume.go
generated
vendored
|
@ -3,6 +3,9 @@ package sha512
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/gob"
|
||||
|
||||
// import to ensure that our init function runs after the standard package
|
||||
_ "crypto/sha512"
|
||||
)
|
||||
|
||||
// Len returns the number of bytes which have been written to the digest.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue