lens @ c3ea735c0f03a0827a8e753a5b5adf6e31f4c925

 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}