function encode(data) {
  let dataText = JSON.stringify(data)
  let dataBytes = utf8.encode(dataText)
  let encodedData = base64.encode(dataBytes)

  return encodedData
}
Encodes data encoded with base64 and utf8 encodings.

@param {Any} data
@return {String}