code: function encodeData (data) {
      // json encode data
      data = jsonStableStringify(data)
      // compress if compression in use
      if (this.compression) {
          data = snappy.compressSync(data).toString('base64')
      }
      // return encoded data
      return data
  }
docs: @function encodeData
  
  encode object to Buffer for storage in database
  
  @param {object} data
  
  @returns {string|Buffer}
  
  @throws {Error}