const buffer = Buffer.from('This is a test string');
const base64 = buffer.toString('base64');
const hexString = buffer.toString('hex');

module.exports = {
  buffer,
  base64,
  hexString
};

const buffer = Buffer.from([0x72, 0x98, 0x4f, 0x96, 0x75, 0x03, 0xcd, 0x28, 0x38, 0xbf]);
const base64 = buffer.toString('base64');
const hexString = buffer.toString('hex');

module.exports = {
  buffer,
  base64,
  hexString
};

Use non utf8 buffer to help catch decoding errors e.g When using a utf8 string buffer we could store the buffer as a utf8 string and tests would pass. If you then tried to encode/decode an image you'd get incorrect results.
Use non utf8 buffer to help catch decoding errors
e.g When using a utf8 string buffer we could store the buffer as a utf8 string and tests would pass. If you then tried to encode/decode an image you'd get incorrect results.
