Performer checksum from name. Default image

This commit is contained in:
WithoutPants
2019-08-21 12:51:30 +10:00
parent 32a4f34c7c
commit 996fd9c70a
8 changed files with 30 additions and 14 deletions

View File

@@ -12,6 +12,11 @@ func MD5FromBytes(data []byte) string {
return fmt.Sprintf("%x", result)
}
func MD5FromString(str string) string {
data := []byte(str)
return MD5FromBytes(data)
}
func MD5FromFilePath(filePath string) (string, error) {
f, err := os.Open(filePath)
if err != nil {