mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Reorder preferred hash list
This commit is contained in:
parent
6bb15f593b
commit
9585272311
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user