1package fileop
2
3import (
4 "crypto/md5"
5 "encoding/hex"
6 "strings"
7)
8
9func GetHashFromPath(path string) string {
10 hash := md5.Sum([]byte(path))
11 return hex.EncodeToString(hash[:])
12}
13
14func IsMimeTypeSupported(mimetype string) bool {
15 if mimetype == "image/svg+xml" ||
16 mimetype == "video/mp2t" {
17 return false
18 }
19 return strings.HasPrefix(mimetype, "video") ||
20 strings.HasPrefix(mimetype, "image")
21}