Garry's Mod Wiki

Garry's Mod Wiki

  string util.Base64Encode( string str, boolean inline = false )

Description

Encodes the specified string to base64.

Unless disabled with the inline argument, the Base64 returned is compliant to the RFC 2045 standard. This means it will have a line break after every 76th character.

Arguments

1 string str
String to encode.
2 boolean inline = false
true to disable RFC 2045 compliance (newline every 76th character)

Returns

1 string
Base 64 encoded string.

Example

Encodes a string

local encoded = util.Base64Encode( "Base64 Encoding" ) print(encoded)
Output: QmFzZTY0IEVuY29kaW5n

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...