#api/space-lua

The encoding API implements a few useful functions to handle various types of encoding.

encoding.base64Encode(data)

Encodes data (either a string or byte buffer) as a base64 encoded string.

encoding.base64Decode(s)

Decodes a base64 encoded string into a byte buffer.

encoding.utf8Encode(s)

Encodes a (UTF-8) string into a byte buffer.

encoding.utf8Decode(data)

Decodes a byte buffer into a (UTF-8) string.