fastpy_rs.datatools
def
base64_encode(data):
Encodes a byte slice into a base64 encoded string.
Arguments
data- The byte slice to encode
Returns
A String containing the base64 encoded data
Examples
from fastpy_rs.datatools import base64_encode
encoded = base64_encode(b"hello")
assert encoded == 'aGVsbG8='
Panics
This function will panic if the input data cannot be encoded as base64, though this is extremely unlikely as base64 can encode any binary data.