removed some unused functions from util

This commit is contained in:
BroodjeAap 2020-08-18 19:05:57 +00:00
parent 62ac74c782
commit fc6c54c834

15
util.go
View file

@ -1,27 +1,12 @@
package main package main
import ( import (
"crypto/sha256"
"encoding/base64"
"log" "log"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
) )
// URLToBase64 returns the base64 encoding of the URL parameter
func URLToBase64(URL string) string {
h := sha256.New()
h.Write([]byte(URL))
return base64.URLEncoding.EncodeToString(h.Sum(nil))
}
// Base64ToURL returns the string decoded base64 value
func Base64ToURL(value string) string {
decoded, _ := base64.URLEncoding.DecodeString(value)
return string(decoded)
}
// FileExists returns true if path exists // FileExists returns true if path exists
func FileExists(path string) bool { func FileExists(path string) bool {
_, err := os.Stat(path) _, err := os.Stat(path)