Skip to main content
base64encode(str) encodes str as standard base64 and returns the encoded string.

Signature

Example

Encode credentials for an HTTP Basic Auth header before passing them to a command:

Notes

  • The output uses standard base64 (with + and /). Some systems expect URL-safe base64 (with - and _). Use replace to convert the + and / characters if needed.
  • For the reverse operation, use base64decode.