Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

encode base64 for formats

Encode a string or binary value using Base64.

Signature

> encode base64 {flags}

Flags

  • --url: Use the URL-safe Base64 version.
  • --nopad: Don't pad the output.

Input/output types:

inputoutput
binarystring
stringstring

Examples

Encode a string with Base64

> "Alphabet from A to Z" | encode base64
QWxwaGFiZXQgZnJvbSBBIHRvIFo=

Encode arbitrary data

> 0x[BE EE FF] | encode base64
vu7/

Use a URL-safe alphabet

> 0x[BE EE FF] | encode base64 --url
vu7_

Notes

The default alphabet is taken from RFC 4648, section 4. A URL-safe version is available.

Note this command will collect stream input.