File tree 1 file changed +25
-2
lines changed
1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,17 @@ 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
+ "github.com/zeebo/blake3"
20
+ "golang.org/x/crypto/blake2b"
21
+ "golang.org/x/crypto/sha3"
19
22
)
20
23
21
24
func benchmarkHashAlgo (b * testing.B , h hash.Hash ) {
@@ -33,6 +36,26 @@ func BenchmarkAdler32(b *testing.B) {
33
36
benchmarkHashAlgo (b , adler32 .New ())
34
37
}
35
38
39
+ func BenchmarkBlake2b256 (b * testing.B ) {
40
+ h , err := blake2b .New256 (nil )
41
+ if err != nil {
42
+ b .Fatal (err )
43
+ }
44
+ benchmarkHashAlgo (b , h )
45
+ }
46
+
47
+ func BenchmarkBlake2b512 (b * testing.B ) {
48
+ h , err := blake2b .New512 (nil )
49
+ if err != nil {
50
+ b .Fatal (err )
51
+ }
52
+ benchmarkHashAlgo (b , h )
53
+ }
54
+
55
+ func BenchmarkBlake3256 (b * testing.B ) {
56
+ benchmarkHashAlgo (b , blake3 .New ())
57
+ }
58
+
36
59
func BenchmarkCRC32 (b * testing.B ) {
37
60
benchmarkHashAlgo (b , crc32 .NewIEEE ())
38
61
}
You can’t perform that action at this time.
0 commit comments