forked from rogpeppe/go-internal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash.go
More file actions
31 lines (23 loc) · 749 Bytes
/
Copy pathhash.go
File metadata and controls
31 lines (23 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Package dirhash is a thin forwarding layer on top of
// [golang.org/x/mod/sumdb/dirhash]. See that package for documentation.
//
// Deprecated: use [golang.org/x/mod/sumdb/dirhash] instead.
package dirhash
import (
"io"
"golang.org/x/mod/sumdb/dirhash"
)
var DefaultHash = dirhash.Hash1
type Hash = dirhash.Hash
func Hash1(files []string, open func(string) (io.ReadCloser, error)) (string, error) {
return dirhash.Hash1(files, open)
}
func HashDir(dir, prefix string, hash Hash) (string, error) {
return dirhash.HashDir(dir, prefix, hash)
}
func DirFiles(dir, prefix string) ([]string, error) {
return dirhash.DirFiles(dir, prefix)
}
func HashZip(zipfile string, hash Hash) (string, error) {
return dirhash.HashZip(zipfile, hash)
}