aboutsummaryrefslogtreecommitdiff
path: root/pkg/fileop/file.go
blob: 07c08e5d57eff695d8658ae7626adfb132e7f4d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package fileop

import (
	"crypto/md5"
	"encoding/hex"
	"strings"
)

func GetHashFromPath(path string) string {
	hash := md5.Sum([]byte(path))
	return hex.EncodeToString(hash[:])
}

func IsMimeTypeSupported(mimetype string) bool {
	return strings.HasPrefix(mimetype, "video") &&
		strings.HasPrefix(mimetype, "image")
}