| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package dirhash |
| 6 |
|
| 7 |
import ( |
| 8 |
"io" |
| 9 |
|
| 10 |
"golang.org/x/mod/sumdb/dirhash" |
| 11 |
) |
| 12 |
|
| 13 |
var DefaultHash = dirhash.Hash1 |
| 14 |
|
| 15 |
type Hash = dirhash.Hash |
| 16 |
|
| 17 |
func Hash1(files []string, open func(string) (io.ReadCloser, error)) (string, error) { |
| 18 |
return dirhash.Hash1(files, open) |
| 19 |
} |
| 20 |
|
| 21 |
func HashDir(dir, prefix string, hash Hash) (string, error) { |
| 22 |
return dirhash.HashDir(dir, prefix, hash) |
| 23 |
} |
| 24 |
|
| 25 |
func DirFiles(dir, prefix string) ([]string, error) { |
| 26 |
return dirhash.DirFiles(dir, prefix) |
| 27 |
} |
| 28 |
|
| 29 |
func HashZip(zipfile string, hash Hash) (string, error) { |
| 30 |
return dirhash.HashZip(zipfile, hash) |
| 31 |
} |