-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrappers.go
93 lines (72 loc) · 1.41 KB
/
wrappers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package concurrenthash
import (
"crypto/sha256"
"crypto/sha512"
"hash"
"hash/adler32"
"hash/crc32"
"hash/crc64"
"hash/fnv"
"github.com/twmb/murmur3"
)
func WrapAdler32() hash.Hash {
return adler32.New()
}
func WrapCrc32IEEE() hash.Hash {
return crc32.NewIEEE()
}
func WrapCrc32Castagnoli() hash.Hash {
return crc32.New(crc32.MakeTable(crc32.Castagnoli))
}
func WrapCrc32Koopman() hash.Hash {
return crc32.New(crc32.MakeTable(crc32.Koopman))
}
/*
func WrapCrc32Custom(table uint32) func() hash.Hash {
return func() hash.Hash {
return crc32.New(crc32.MakeTable(table))
}
}
*/
func WrapCrc64ISO() hash.Hash {
return crc64.New(crc64.MakeTable(crc64.ISO))
}
func WrapCrc64ECMA() hash.Hash {
return crc64.New(crc64.MakeTable(crc64.ECMA))
}
func WrapFnv32() hash.Hash {
return fnv.New32()
}
func WrapFnv32a() hash.Hash {
return fnv.New32a()
}
func WrapFnv64() hash.Hash {
return fnv.New64()
}
func WrapFnv64a() hash.Hash {
return fnv.New64a()
}
func WrapMurmur32() hash.Hash {
return murmur3.New32()
}
func WrapMurmur64() hash.Hash {
return murmur3.New64()
}
func WrapSha512() hash.Hash {
return sha512.New()
}
func WrapSha384() hash.Hash {
return sha512.New384()
}
func WrapSha512224() hash.Hash {
return sha512.New512_224()
}
func WrapSha512256() hash.Hash {
return sha512.New512_256()
}
func WrapSha256() hash.Hash {
return sha256.New()
}
func WrapSha224() hash.Hash {
return sha256.New224()
}