Class Marshalls
Data transformation (marshaling) and encoding helpers.
- Inheritance
-
Marshalls
Remarks
Provides data transformation and encoding utility functions.
Methods
base64_to_raw(String)
Returns a decoded PackedByteArray corresponding to the Base64-encoded string base64_str
.
PackedByteArray base64_to_raw(String base64_str)
Parameters
base64_str
String
base64_to_utf8(String)
Returns a decoded string corresponding to the Base64-encoded string base64_str
.
String base64_to_utf8(String base64_str)
Parameters
base64_str
String
base64_to_variant(String, bool)
Returns a decoded Variant corresponding to the Base64-encoded string base64_str
. If allow_objects
is true
, decoding objects is allowed.
Internally, this uses the same decoding mechanism as the @GlobalScope.bytes_to_var method.
Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.
Variant base64_to_variant(String base64_str, bool allow_objects)
Parameters
raw_to_base64(PackedByteArray)
Returns a Base64-encoded string of a given PackedByteArray.
String raw_to_base64(PackedByteArray array)
Parameters
array
PackedByteArray
utf8_to_base64(String)
Returns a Base64-encoded string of the UTF-8 string utf8_str
.
String utf8_to_base64(String utf8_str)
Parameters
utf8_str
String
variant_to_base64(Variant, bool)
Returns a Base64-encoded string of the Variant variant
. If full_objects
is true
, encoding objects is allowed (and can potentially include code).
Internally, this uses the same encoding mechanism as the @GlobalScope.var_to_bytes method.
String variant_to_base64(Variant variant, bool full_objects)