mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Modrinth Support (#11)
Co-authored-by: comp500 <comp500@users.noreply.github.com>
This commit is contained in:
@@ -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":
|
||||
|
@@ -3,12 +3,12 @@ package core
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"fmt"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
Reference in New Issue
Block a user