File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,16 @@ import (
8
8
"crypto/sha1"
9
9
"crypto/sha256"
10
10
"crypto/sha512"
11
- "github.com/jzelinskie/whirlpool"
12
- "golang.org/x/crypto/sha3"
13
11
"hash"
14
12
"hash/adler32"
15
13
"hash/crc32"
16
14
"hash/fnv"
17
15
"math/rand"
18
16
"testing"
17
+
18
+ "github.com/jzelinskie/whirlpool"
19
+ "golang.org/x/crypto/blake2b"
20
+ "golang.org/x/crypto/sha3"
19
21
)
20
22
21
23
func benchmarkHashAlgo (b * testing.B , h hash.Hash ) {
@@ -33,6 +35,22 @@ func BenchmarkAdler32(b *testing.B) {
33
35
benchmarkHashAlgo (b , adler32 .New ())
34
36
}
35
37
38
+ func BenchmarkBlake2b256 (b * testing.B ) {
39
+ h , err := blake2b .New256 (nil )
40
+ if err != nil {
41
+ b .Fatal (err )
42
+ }
43
+ benchmarkHashAlgo (b , h )
44
+ }
45
+
46
+ func BenchmarkBlake2b512 (b * testing.B ) {
47
+ h , err := blake2b .New512 (nil )
48
+ if err != nil {
49
+ b .Fatal (err )
50
+ }
51
+ benchmarkHashAlgo (b , h )
52
+ }
53
+
36
54
func BenchmarkCRC32 (b * testing.B ) {
37
55
benchmarkHashAlgo (b , crc32 .NewIEEE ())
38
56
}
You can’t perform that action at this time.
0 commit comments