1
0
Fork 0
mirror of https://github.com/vbatts/dedupe-linker.git synced 2024-12-27 17:16:32 +00:00

cryptomap: golint

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-09-13 10:40:39 -04:00
parent 267c961503
commit 7ea5cd6bc4

View file

@ -2,19 +2,24 @@ package cryptomap
import (
"crypto"
"log"
"strings"
// Importing all the currently supported hashes
_ "crypto/md5"
_ "crypto/sha1"
_ "crypto/sha256"
_ "crypto/sha512"
"log"
"strings"
)
var knownCiphers = map[string]crypto.Hash{
"md5": crypto.MD5,
}
// DetermineHash takes a generic string, like "sha1" and returns the
// corresponding crypto.Hash
func DetermineHash(str string) (h crypto.Hash) {
// TODO make these strings discoverable, like a public variable
switch strings.ToLower(str) {
case "md5":
h = crypto.MD5