diff options
| author | ac79b0c6 <[email protected]> | 2022-05-07 10:45:16 +0800 |
|---|---|---|
| committer | ac79b0c6 <[email protected]> | 2022-05-07 10:45:16 +0800 |
| commit | d34cea33c9a9aed2f330713efdcb375e198ee287 (patch) | |
| tree | ca153156516bf7c3e7ed968ee84d5ef244a5ff0c /mkvtool/utils.go | |
| parent | a0b27e3e3caa53233f98106e69cfd3d47173b0ad (diff) | |
update mkvtool:fix caches
Diffstat (limited to 'mkvtool/utils.go')
| -rw-r--r-- | mkvtool/utils.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mkvtool/utils.go b/mkvtool/utils.go index e60afe8..835e88c 100644 --- a/mkvtool/utils.go +++ b/mkvtool/utils.go @@ -1,7 +1,9 @@ package main import ( + "crypto/md5" "errors" + "fmt" "os" "path/filepath" "regexp" @@ -48,3 +50,10 @@ func splitPath(p string) (dir, name, ext, namewithoutext string) { } return } + +func path2MD5(p string) string { + p, _ = filepath.Abs(p) + h := md5.New() + h.Write([]byte(p)) + return fmt.Sprintf("%x", h.Sum(nil)) +} |
