diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-06-04 14:13:20 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-06-04 14:13:20 +0900 |
| commit | 729be19af39fb73e827bdb2798ac23942f9cf9e5 (patch) | |
| tree | 142f876c8533e312fbfddf0348195aeb3530e7d6 /internal/pkg/archive.go | |
| parent | 4d04f86f4a85007544932a28bd4c779f8bfb561b (diff) | |
internal/pkg: rename archive checksum helpers
These names are more consistent with other helper names, so rename them while the API is still internal.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/archive.go')
| -rw-r--r-- | internal/pkg/archive.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/pkg/archive.go b/internal/pkg/archive.go index ebda6dbf..8b5398fa 100644 --- a/internal/pkg/archive.go +++ b/internal/pkg/archive.go @@ -262,8 +262,8 @@ func Write(fsys fs.FS, root string, w io.Writer) error { return aw.Close() } -// HashFS returns a checksum produced by hashing the result of [Flatten]. -func HashFS(buf *Checksum, fsys fs.FS, root string) error { +// SumFS saves checksum of the archive of fsys to the value pointed to by buf. +func SumFS(buf *Checksum, fsys fs.FS, root string) error { h := sha512.New384() if err := Write(fsys, root, h); err != nil { return err @@ -272,7 +272,8 @@ func HashFS(buf *Checksum, fsys fs.FS, root string) error { return nil } -// HashDir returns a checksum produced by hashing the result of [Flatten]. -func HashDir(buf *Checksum, pathname *check.Absolute) error { - return HashFS(buf, os.DirFS(pathname.String()), ".") +// SumDir saves checksum of the archive of directory at pathname to the value +// pointed to by buf. +func SumDir(buf *Checksum, pathname *check.Absolute) error { + return SumFS(buf, os.DirFS(pathname.String()), ".") } |
