encodeBase64 - Encode a base64 string
encodeBase64
will transform a string into its Base64 encoded value.
Syntax
Like many functions in DataPrime, encodeBase64
supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
Name | Type | Required | Description |
---|---|---|---|
value | string | true | The string to be base64 encoded |
Example - Encoding URLs into Base64
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.
If we want to view to basse64 encode our full_url
value, we can use encodeBase64
:
The resulting document will look like this:
{
"path": "/home",
"domain": "coralogix.com",
"full_url_encoded": "aHR0cHM6Ly9jb3JhbG9naXguY29tL2hvbWU=",
"full_url": "https://coralogix.com/home"
}
Theme
Light