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
1 changed files with 7 additions and 2 deletions

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