Native base64 encoding/decoding API

As a Roblox developer, it’s currently impossible to encode and decode base64 at a reasonable speed. Base64 is useful for dealing with binary data when the ASCII charset is forced.

Native solutions can hit speeds of several gigabytes per second, depending on what features are available. However, pure-lua implementations (such as mine) tend to only hit around (and very often under) 1 megabyte per second. That would absolutely lead to situations where the server or client would “freeze” for a short period of time because it’s busy encoding a large base64 payload.

Giving developers a faster base64 encoder/decoder would allow them to create more space-efficient compressed data without worrying about base64 speed. In addition to saving binary data in Datastores and sending it over RemoteEvents, base64 is also useful in dealing with various web APIs.

As such, I propose the base64 API would be as Base64Encode and Base64Decode methods under HttpService to be consistent with the JSON encoding/decoding methods.

61 Likes

Bumping this because it’s still absolutely needed. Base64 operations would be extremely useful for compressing numbers in datastores and especially memory queues, which have a strict data limit.

2 Likes

this. this is why we need this. Roblox APIs hate NUL bytes

4 Likes

I need this as well. I have a game that needs to manage large chunks of heavily compressed data and an official Base64 API would be very useful for encoding and decoding it rather than using a slower module.

2 Likes