App for fetching and uploading images to cloud bucket storage

This commit is contained in:
2022-12-10 15:27:24 +01:00
commit b56c3d1e29
18 changed files with 749 additions and 0 deletions

14
util/hash.go Normal file
View File

@@ -0,0 +1,14 @@
package util
import (
"crypto/sha1"
"fmt"
)
// Hash hashes a string using sha1
func Hash(s string) string {
hash := sha1.New()
_, _ = hash.Write([]byte(s))
bs := hash.Sum(nil)
return fmt.Sprintf("%x", bs)
}