lens @ c2d666b43477ea7042b574ad940c508216cb0e83

 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		return false
17	}
18	return strings.HasPrefix(mimetype, "video") ||
19		strings.HasPrefix(mimetype, "image")
20}