1
0
mirror of https://github.com/packwiz/packwiz.git synced 2025-04-29 01:26:29 +02:00

Lowercase hashes before comparing them ()

This commit is contained in:
AppleTheGolden 2021-01-13 20:00:04 +01:00 committed by GitHub
parent b8887e6704
commit f2c6b89932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

1
.gitignore vendored

@ -1,4 +1,5 @@
# Binaries for programs and plugins
/packwiz
*.exe
*.exe~
*.dll

@ -4,13 +4,14 @@ import (
"crypto/md5"
"crypto/sha256"
"crypto/sha512"
"strings"
"errors"
"hash"
)
// GetHashImpl gets an implementation of hash.Hash for the given hash type string
func GetHashImpl(hashType string) (hash.Hash, error) {
switch hashType {
switch strings.ToLower(hashType) {
case "sha256":
return sha256.New(), nil
case "sha512":