Encoding
Function | Description | Meta |
---|---|---|
base64.decode |
Deserializes the base64 encoded input string. Arguments: Returns:x (string)string to decode y (string)base64 deserialization of | Wasm |
base64.encode |
Serializes the input string into base64 encoding. Arguments: Returns:x (string)string to encode y (string)base64 serialization of | Wasm |
base64.is_valid |
Verifies the input string is base64 encoded. Arguments: Returns:x (string)string to check result (boolean)
| v0.24.0 Wasm |
base64url.decode |
Deserializes the base64url encoded input string. Arguments: Returns:x (string)string to decode y (string)base64url deserialization of | Wasm |
base64url.encode |
Serializes the input string into base64url encoding. Arguments: Returns:x (string)string to encode y (string)base64url serialization of | Wasm |
base64url.encode_no_pad |
Serializes the input string into base64url encoding without padding. Arguments: Returns:x (string)string to encode y (string)base64url serialization of | v0.25.0-rc2 SDK-dependent |
hex.decode |
Deserializes the hex-encoded input string. Arguments: Returns:x (string)a hex-encoded string y (string)deserialized from | v0.25.0-rc2 SDK-dependent |
hex.encode |
Serializes the input string using hex-encoding. Arguments: Returns:x (string)string to encode y (string)serialization of | v0.25.0-rc2 SDK-dependent |
json.is_valid |
Verifies the input string is a valid JSON document. Arguments: Returns:x (string)a JSON string result (boolean)
| v0.25.0-rc1 Wasm |
json.marshal |
Serializes the input term to JSON. Arguments: Returns:x (any)the term to serialize y (string)the JSON string representation of | Wasm |
json.marshal_with_options |
Serializes the input term JSON, with additional formatting options via the Arguments: Returns:x (any)the term to serialize opts (object<indent: string, prefix: string, pretty: boolean>[string: any])encoding options y (string)the JSON string representation of | v0.64.0 SDK-dependent |
json.unmarshal |
Deserializes the input string. Arguments: Returns:x (string)a JSON string y (any)the term deserialized from | Wasm |
urlquery.decode |
Decodes a URL-encoded input string. Arguments: Returns:x (string)the URL-encoded string y (string)URL-encoding deserialization of | SDK-dependent |
urlquery.decode_object |
Decodes the given URL query string into an object. Arguments: Returns:x (string)the query string object (object[string: array[string]])the resulting object | v0.24.0 SDK-dependent |
urlquery.encode |
Encodes the input string into a URL-encoded string. Arguments: Returns:x (string)the string to encode y (string)URL-encoding serialization of | SDK-dependent |
urlquery.encode_object |
Encodes the given object into a URL encoded query string. Arguments: Returns:object (object[string: any<string, array[string], set[string]>])the object to encode y (string)the URL-encoded serialization of | SDK-dependent |
yaml.is_valid |
Verifies the input string is a valid YAML document. Arguments: Returns:x (string)a YAML string result (boolean)
| v0.25.0-rc1 SDK-dependent |
yaml.marshal |
Serializes the input term to YAML. Arguments: Returns:x (any)the term to serialize y (string)the YAML string representation of | SDK-dependent |
yaml.unmarshal |
Deserializes the input string. Arguments: Returns:x (string)a YAML string y (any)the term deserialized from | SDK-dependent |
The json.marshal_with_options
builtin's opts
parameter accepts the following properties:
Field | Required | Type | Default | Description |
---|---|---|---|---|
pretty | No | bool | true if indent or prefix are declared, false otherwise | Enables multi-line, human-readable JSON output ("pretty-printing"). If this property is true , then objects will be marshaled into multi-line JSON with either user-specified or default indent/prefix options. If this property is false , indent /prefix will be ignored and this builtin functions identically to json.marshal() . |
indent | No | string | "\t" (Horizontal tab, character 0x09) | The string to use when indenting nested keys in the emitted JSON. One or more copies of this string will be included before child elements in every object or array. |
prefix | No | string | "" (empty) | The string to prefix lines with in the emitted JSON. One copy of this string will be prepended to each line. |
Default values will be used if:
opts
is an empty object.opts
does not contain the named property.