removed some unused functions from util
This commit is contained in:
parent
62ac74c782
commit
fc6c54c834
1 changed files with 0 additions and 15 deletions
15
util.go
15
util.go
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue