encodeBase64Packet static method
dynamic
encodeBase64Packet(
- dynamic packet,
- dynamic callback
Encodes a packet with binary data in a base64 string
@param {Object} packet, has type
and data
@return {String} base64 encoded message
Implementation
static encodeBase64Packet(packet, callback) {
var message = '''b${PacketTypeMap[packet['type']]}''';
message += base64.encode(packet.data.toString().codeUnits);
return callback(message);
}