Skip to content

Commit

Permalink
sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
kmulvey committed Dec 17, 2022
1 parent a3f573e commit 9f956e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wrappers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package concurrenthash

import (
"crypto/sha256"
"crypto/sha512"
"hash"
"hash/adler32"
Expand Down Expand Up @@ -82,3 +83,11 @@ func WrapSha512224() hash.Hash {
func WrapSha512256() hash.Hash {
return sha512.New512_256()
}

func WrapSha256() hash.Hash {
return sha256.New()
}

func WrapSha224() hash.Hash {
return sha256.New224()
}
2 changes: 2 additions & 0 deletions wrappers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ var testMatrix = []testPair{
{HashFunc: WrapSha384, Expected: "fe7ce20c68d58076774402eb2bb27c57978a69f3ae7778387ddd52bc9e4d48f7a42496a97dd97bb560be23ecccecabd5"},
{HashFunc: WrapSha512224, Expected: "8fa68c2902b434728a005ffdc77338b84b7784f58e7f6832b09d1d2b"},
{HashFunc: WrapSha512256, Expected: "800b50f0c527cd902b7d5478ea9bbc277b2aaa6e15d5e9ff024cbf31ed582661"},
{HashFunc: WrapSha256, Expected: "bf842e96b246556052bc7e518de1fdf7c4a5a859ad104a201880074bece30b82"},
{HashFunc: WrapSha224, Expected: "c50e3b0a3f05746297ce9409495e77e91f4b305953ad352a7a264f39"},
}

func TestWrappers(t *testing.T) {
Expand Down

0 comments on commit 9f956e2

Please sign in to comment.