docs: function encodeBinaryField(field, obj) {
    var bfield = field + '_base64';
    if (bfield in obj) {
      if (typeof obj[bfield] !== 'string')
        throw new Error('Field "' + bfield + '" should be string');
    } else if (field in obj) {
      if (obj[field] instanceof Buffer) {
        obj[bfield] = obj[field].toString('base64');
        delete obj[field];
      }
    } else {
      return true;
    }
  }