Modrinth Support (#11)

Co-authored-by: comp500 <comp500@users.noreply.github.com>
This commit is contained in:
TheEpicBlock
2021-02-16 17:34:52 +01:00
committed by GitHub
parent f2c6b89932
commit b5b9fd6810
8 changed files with 713 additions and 2 deletions

View File

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

View File

@@ -3,12 +3,12 @@ package core
import (
"encoding/hex"
"errors"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strconv"
"fmt"
"github.com/BurntSushi/toml"
)