Files
nomad/website/content/docs/job-specification/hcl2/functions/encoding/base64decode.mdx
Ashlee M Boyer 3444ece549 docs: Migrate link formats (#15779)
* Adding check-legacy-links-format workflow

* Adding test-link-rewrites workflow

* chore: updates link checker workflow hash

* Migrating links to new format

Co-authored-by: Kendall Strautman <kendallstrautman@gmail.com>
2023-01-25 09:31:14 -08:00

31 lines
945 B
Plaintext

---
layout: docs
page_title: base64decode - Functions - Configuration Language
description: The base64decode function decodes a string containing a base64 sequence.
---
# `base64decode` Function
`base64decode` takes a string containing a Base64 character sequence and
returns the original string.
Nomad uses the "standard" Base64 alphabet as defined in
[RFC 4648 section 4](https://tools.ietf.org/html/rfc4648#section-4).
Strings in the Nomad language are sequences of unicode characters rather
than bytes, so this function will also interpret the resulting bytes as
UTF-8. If the bytes after Base64 decoding are _not_ valid UTF-8, this function
produces an error.
## Examples
```shell-session
> base64decode("SGVsbG8gV29ybGQ=")
Hello World
```
## Related Functions
- [`base64encode`](/nomad/docs/job-specification/hcl2/functions/encoding/base64encode) performs the opposite operation,
encoding the UTF-8 bytes for a string as Base64.