Support Modrinth modpack fileSize field and sha512 hash

This commit is contained in:
comp500
2022-05-16 01:15:12 +01:00
parent 9ace015690
commit 2073e4475e
6 changed files with 151 additions and 41 deletions

View File

@@ -116,7 +116,7 @@ func (pack *Pack) UpdateIndexHash() error {
// Hash usage strategy (may change):
// Just use SHA256, overwrite existing hash regardless of what it is
// May update later to continue using the same hash that was already being used
h, stringer, err := GetHashImpl("sha256")
h, err := GetHashImpl("sha256")
if err != nil {
_ = f.Close()
return err
@@ -125,7 +125,7 @@ func (pack *Pack) UpdateIndexHash() error {
_ = f.Close()
return err
}
hashString := stringer.HashToString(h.Sum(nil))
hashString := h.HashToString(h.Sum(nil))
pack.Index.HashFormat = "sha256"
pack.Index.Hash = hashString