Base64Encode: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
SDraw (talk | contribs)
Created page with "__NOTOC__ {{Server client function}} {{New feature/item|9.06056|1.3.5|6056| This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypte..."
 
Nico834 (talk | contribs)
Set base64Encode deprecated as #3312
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
{{New feature/item|9.06056|1.3.5|6056|
This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encoded block of data
This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block of data
 
}}
{{deprecated|encodeString}}


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
string base64Encode(string/int data)
string base64Encode ( string data )
</syntaxhighlight>
</syntaxhighlight>


===Required arguments===
===Required arguments===
*'''data:''' The block of data you want to encrypt
*'''data:''' The block of data you want to encode


===Returns===
===Returns===
Returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted data if the encryption process was successfully completed, ''false'' otherwise.
Returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encoded data if the encoding process was successfully completed, ''false'' otherwise.


==Example==
==Example==

Latest revision as of 19:53, 19 February 2024

This function returns the base64 representation of the encoded block of data


This function is deprecated. This means that its use is discouraged and that it might not exist in future versions.

Please use encodeString instead.


Syntax

string base64Encode ( string data )

Required arguments

  • data: The block of data you want to encode

Returns

Returns the base64 representation of the encoded data if the encoding process was successfully completed, false otherwise.

Example

local k = base64Encode("Hello, world!")
outputConsole(k)
--Output: SGVsbG8sIHdvcmxkIQ==

See Also