import { decodeText, encodeText } from "./byte_util";
import { Bytes } from "./rtmt";

const headerLenght = 4
//
// channel is string, message is byte array
//
export function encode(channel : string, message : Object) {
    return JSON.stringify({
        channel,
        message
    })
}

// 
// return { channel :  string, message :  byte array} 
//
export function decode(bytes : string) {
    return JSON.parse(bytes);
}
