File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ func encode(name string) (string, error) {
3737 return "" , fmt .Errorf ("key name must be at least one character" )
3838 }
3939
40- encodedName := base32 .StdEncoding .EncodeToString ([]byte (name ))
40+ encoder := base32 .StdEncoding .WithPadding (base32 .NoPadding )
41+ encodedName := encoder .EncodeToString ([]byte (name ))
4142 return keyFilenamePrefix + strings .ToLower (encodedName ), nil
4243}
4344
@@ -47,7 +48,8 @@ func decode(name string) (string, error) {
4748 }
4849
4950 nameWithoutPrefix := strings .ToUpper (name [len (keyFilenamePrefix ):])
50- data , err := base32 .StdEncoding .DecodeString (nameWithoutPrefix )
51+ decoder := base32 .StdEncoding .WithPadding (base32 .NoPadding )
52+ data , err := decoder .DecodeString (nameWithoutPrefix )
5153
5254 return string (data ), err
5355}
You can’t perform that action at this time.
0 commit comments