aboutsummaryrefslogtreecommitdiff
path: root/internal/nametransform/longnames.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/nametransform/longnames.go')
-rw-r--r--internal/nametransform/longnames.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/nametransform/longnames.go b/internal/nametransform/longnames.go
index 71a4c16..f9ba848 100644
--- a/internal/nametransform/longnames.go
+++ b/internal/nametransform/longnames.go
@@ -2,7 +2,6 @@ package nametransform
import (
"crypto/sha256"
- "encoding/base64"
"io/ioutil"
"os"
"path/filepath"
@@ -24,9 +23,9 @@ const (
// HashLongName - take the hash of a long string "name" and return
// "gocryptfs.longname.[sha256]"
-func HashLongName(name string) string {
+func (n *NameTransform) HashLongName(name string) string {
hashBin := sha256.Sum256([]byte(name))
- hashBase64 := base64.URLEncoding.EncodeToString(hashBin[:])
+ hashBase64 := n.b64.EncodeToString(hashBin[:])
return longNamePrefix + hashBase64
}