This Commented CUE demonstrates how to use the built-in function encoding/base64.Encode to encode a string as Base64.

file.cue
package example

import "encoding/base64"

decoded: "some string"
encoded: base64.Encode(null, decoded)
TERMINAL
$ cue export
{
    "decoded": "some string",
    "encoded": "c29tZSBzdHJpbmc="
}