mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-19 01:24:32 +01:00
Implement pack importing/exporting for downloaded Curseforge packs
Abstract out hash implementations Implement file saving/downloading
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,10 @@ 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 := sha256.New()
|
||||
h, err := GetHashImpl("sha256")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.Copy(h, f); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user