1
0
Fork 0
mirror of https://github.com/Luzifer/korvike.git synced 2024-11-08 15:30:05 +00:00
korvike/functions/func_base64.go
Knut Ahlers 047d4406ad
Add support for b64decode
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2021-08-30 15:55:52 +02:00

13 lines
351 B
Go

package functions
import "encoding/base64"
func init() {
registerFunction("b64decode", func(name string, v ...string) (string, error) {
b, err := base64.StdEncoding.DecodeString(name)
return string(b), err
})
registerFunction("b64encode", func(name string, v ...string) string {
return base64.StdEncoding.EncodeToString([]byte(name))
})
}