mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-18 00:04:32 +02:00
Reorder preferred hash list
This commit is contained in:
@@ -317,7 +317,11 @@ func shouldDownloadOnSide(side string) bool {
|
||||
|
||||
func (v VersionFile) getBestHash() (string, string) {
|
||||
//try preferred hashes first
|
||||
val, exists := v.Hashes["sha256"]
|
||||
val, exists := v.Hashes["sha512"]
|
||||
if exists {
|
||||
return "sha512", val
|
||||
}
|
||||
val, exists = v.Hashes["sha256"]
|
||||
if exists {
|
||||
return "sha256", val
|
||||
}
|
||||
@@ -325,10 +329,6 @@ func (v VersionFile) getBestHash() (string, string) {
|
||||
if exists {
|
||||
return "murmur2", val
|
||||
}
|
||||
val, exists = v.Hashes["sha512"]
|
||||
if exists {
|
||||
return "sha512", val
|
||||
}
|
||||
|
||||
//none of the preferred hashes are present, just get the first one
|
||||
for key, val := range v.Hashes {
|
||||
|
Reference in New Issue
Block a user