aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/minio/md5-simd/md5.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
committerLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
commit8db41da676ac8368ef7c2549d56239a5ff5eedde (patch)
tree09c427fd66de2ec1ebffc8342f5fdbb84b0701b5 /vendor/github.com/minio/md5-simd/md5.go
parentd4f75fb6db22e57577867445a022227e70958931 (diff)
downloadgitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.tar.gz
gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.zip
Delete vendor directory
Diffstat (limited to 'vendor/github.com/minio/md5-simd/md5.go')
-rw-r--r--vendor/github.com/minio/md5-simd/md5.go63
1 files changed, 0 insertions, 63 deletions
diff --git a/vendor/github.com/minio/md5-simd/md5.go b/vendor/github.com/minio/md5-simd/md5.go
deleted file mode 100644
index 11b0cb9..0000000
--- a/vendor/github.com/minio/md5-simd/md5.go
+++ /dev/null
@@ -1,63 +0,0 @@
1package md5simd
2
3import (
4 "crypto/md5"
5 "hash"
6 "sync"
7)
8
9const (
10 // The blocksize of MD5 in bytes.
11 BlockSize = 64
12
13 // The size of an MD5 checksum in bytes.
14 Size = 16
15
16 // internalBlockSize is the internal block size.
17 internalBlockSize = 32 << 10
18)
19
20type Server interface {
21 NewHash() Hasher
22 Close()
23}
24
25type Hasher interface {
26 hash.Hash
27 Close()
28}
29
30// StdlibHasher returns a Hasher that uses the stdlib for hashing.
31// Used hashers are stored in a pool for fast reuse.
32func StdlibHasher() Hasher {
33 return &md5Wrapper{Hash: md5Pool.New().(hash.Hash)}
34}
35
36// md5Wrapper is a wrapper around the builtin hasher.
37type md5Wrapper struct {
38 hash.Hash
39}
40
41var md5Pool = sync.Pool{New: func() interface{} {
42 return md5.New()
43}}
44
45// fallbackServer - Fallback when no assembly is available.
46type fallbackServer struct {
47}
48
49// NewHash -- return regular Golang md5 hashing from crypto
50func (s *fallbackServer) NewHash() Hasher {
51 return &md5Wrapper{Hash: md5Pool.New().(hash.Hash)}
52}
53
54func (s *fallbackServer) Close() {
55}
56
57func (m *md5Wrapper) Close() {
58 if m.Hash != nil {
59 m.Reset()
60 md5Pool.Put(m.Hash)
61 m.Hash = nil
62 }
63}