Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

encoding

Subcommands

SubcommandDescriptionSyntax
hexencodeEncodes data into hexadecimal formathexencode(<expr>)
hexdecodeDecodes data in hexadecimal formathexdecode(<expr>)
b64encodeEncodes data into base64 formatb64encode(<expr>)
b64decodeDecodes data in base64 formatb64decode(<expr>)
urlencodeURL-encodes a stringurlencode(<expr>)
urldecodeDecodes data in URL-encoded formaturldecode(<expr>)

Examples

hexencode

For a field data containing hello, this example sets encoded to 68656c6c6f:

| eval encoded=hexencode(data)

hexdecode

For a field data containing 68656c6c6f, this example sets decoded to hello:

| eval decoded=hexdecode(data)

b64encode

For a field data containing hello, this example sets encoded to aGVsbG8=:

| eval encoded=b64encode(data)

b64decode

For a field data containing aGVsbG8=, this example sets decoded to hello:

| eval decoded=b64decode(data)

urlencode

For a field url containing https://example.com?q=test&foo=bar, this example sets encoded to https%3A%2F%2Fexample.com%3Fq%3Dtest%26foo%3Dbar:

| eval encoded=urlencode(url)

urldecode

For a field encoded containing https%3A%2F%2Fexample.com%3Fq%3Dtest%26foo%3Dbar, this example sets decoded to https://example.com?q=test&foo=bar:

| eval decoded=urldecode(encoded)