lib/connection/result/column.js
function convertRawBinary(rawColumnValue, column, context)
{
  // Ensure the format is valid.
  var format = context.format.toUpperCase();
  Errors.assertInternal(format === "HEX" || format === "BASE64");

  // Decode hex string sent by GS.
  var buffer = Buffer.from(rawColumnValue, "HEX");

  if (format === "HEX")
  {
    buffer.toStringSf = function()
    {
      // The raw value is already an uppercase hex string, so just return it.
      // Note that buffer.toString("HEX") returns a lowercase hex string, but we
      // want upper case.
      return rawColumnValue;
    }
  }
  else
  {
    buffer.toStringSf = function()
    {
      return this.toString("BASE64");
    }
  }

  buffer.getFormat = function()
  {
    return format;
  };

  return buffer;
}
function convertRawBinary(rawColumnValue, column, context)
{
  // Ensure the format is valid.
  var format = context.format.toUpperCase();
  Errors.assertInternal(format === "HEX" || format === "BASE64");

  // Decode hex string sent by GS.
  var buffer = Buffer.from(rawColumnValue, "HEX");

  if (format === "HEX")
  {
    buffer.toStringSf = function()
    {
      // The raw value is already an uppercase hex string, so just return it.
      // Note that buffer.toString("HEX") returns a lowercase hex string, but we
      // want upper case.
      return rawColumnValue;
    }
  }
  else
  {
    buffer.toStringSf = function()
    {
      return this.toString("BASE64");
    }
  }

  buffer.getFormat = function()
  {
    return format;
  };

  return buffer;
}
function convertRawBinary ( rawColumnValue , column , context ) { // Ensure the format is valid. var format = context . format . toUpperCase ( ) ; Errors . assertInternal ( format === "HEX" || format === "BASE64" ) ; // Decode hex string sent by GS. var buffer = Buffer . from ( rawColumnValue , "HEX" ) ; if ( format === "HEX" ) { buffer . toStringSf = function ( ) { // The raw value is already an uppercase hex string, so just return it. // Note that buffer.toString("HEX") returns a lowercase hex string, but we // want upper case. return rawColumnValue ; } } else { buffer . toStringSf = function ( ) { return this . toString ( "BASE64" ) ; } } buffer . getFormat = function ( ) { return format ; } ; return buffer ; }
Converts a raw column value of type Binary to a Buffer.

@param {String} rawColumnValue
@param {Object} column
@param {Object} context

@returns {Buffer}
Converts a raw column value of type Binary to a Buffer .