暗号化

base64_encode

文字列を Base64 にエンコードします。

構文

base64_encode(data: string): string
エイリアス base64encodebase64.encodecrypt.base64.encodecrypt.base64_encodecrypt.base64encode

引数

名前説明
datastringBase64 でエンコードされる文字列。

戻り値

名前説明
encodedstringBase64 でエンコードされた文字列。

説明

文字列を Base64 にエンコードします。

1 個のパラメータで呼び出します: data。引数表では必須値と動作を調整する値を確認できます。

encoded (string) を返します。戻り値表を使って成功値、nil 結果、回復可能なエラーを分けて扱ってください。

テキストをエンコードし、デコードして元の値に戻します。

local encoded = base64_encode("hello world")
local decoded = base64_decode(encoded)

print(encoded)
print(decoded)