github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/optional/base64.md (about) 1 # `base64` 2 3 > Encode or decode a base64 string 4 5 ## Description 6 7 An optional builtin to encode or decode a base64 string. 8 9 ## Usage 10 11 ``` 12 <stdin> -> base64 -> <stdout> 13 14 <stdin> -> !base64 -> <stdout> 15 ``` 16 17 ## Examples 18 19 Encode base64 string 20 21 ``` 22 » out "Hello, World!" -> base64 23 SGVsbG8sIFdvcmxkIQo= 24 ``` 25 26 Decode base64 string 27 28 ``` 29 » out "SGVsbG8sIFdvcmxkIQo=" -> !base64 30 Hello, World! 31 ``` 32 33 ## Detail 34 35 `base64` is very simplistic - particularly when compared to its GNU coreutil 36 (for example) counterpart. If you want to use the `base64` binary on Linux 37 or similar platforms then you will need to launch with the `exec` builtin: 38 39 ``` 40 » out "Hello, World!" -> exec base64 41 SGVsbG8sIFdvcmxkIQo= 42 43 » out "SGVsbG8sIFdvcmxkIQo=" -> exec base64 -d 44 Hello, World! 45 ``` 46 47 However for simple tasks this builtin will out perform external tools because 48 it doesn't require the OS fork processes. 49 50 ## Synonyms 51 52 * `base64` 53 * `!base64` 54 55 56 ## See Also 57 58 * [`!bz2`](../optional/bz2.md): 59 Decompress a bz2 file 60 * [`escape`](../commands/escape.md): 61 Escape or unescape input 62 * [`esccli`](../commands/esccli.md): 63 Escapes an array so output is valid shell code 64 * [`eschtml`](../commands/eschtml.md): 65 Encode or decodes text for HTML 66 * [`escurl`](../commands/escurl.md): 67 Encode or decodes text for the URL 68 * [`gz`](../optional/gz.md): 69 Compress or decompress a gzip file 70 71 <hr/> 72 73 This document was generated from [builtins/optional/encoders/base64_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/optional/encoders/base64_doc.yaml).