decodeBase64 - Decode a base64 string
decodeBase64
will transform a Base64 encoded string back into its original value.
Syntax
Arguments
Name | Type | Required | Description |
---|---|---|---|
value | string | true | The base64 encoded string to be decoded |
Example - Decoding base64 encoded URLs
It's common to send data that contains special or reserved characters, like URLs, in Base64 encoded format, to ensure there are no parsing issues.
{
path: "/home",
domain: "coralogix.com",
full_url_encoded: "aHR0cHM6Ly9jb3JhbG9naXguY29tL2hvbWU="
}
If we want to view the original full_url
value, we can use decodeBase64
:
The resulting document will look like this:
{
path: "/home",
domain: "coralogix.com",
full_url_encoded: "aHR0cHM6Ly9jb3JhbG9naXguY29tL2hvbWU=",
full_url: "https://coralogix.com/home"
}
An alternative way to write this function is as follows:
Theme
Light