function _get_base64(bytes) {

        var data = "";

        // Produce binary string from bytes in buffer
        for (var i=0; i<bytes.byteLength; i++)
            data += String.fromCharCode(bytes[i]);

        // Convert to base64
        return window.btoa(data);

    }
Converts the given bytes to a base64-encoded string.

@private
@param {Uint8Array} bytes A Uint8Array which contains the data to be
                          encoded as base64.
@return {String} The base64-encoded string.