lib/auth/scram.js
function xor(a, b) {
  if (!Buffer.isBuffer(a)) a = Buffer.from(a);
  if (!Buffer.isBuffer(b)) b = Buffer.from(b);
  const length = Math.max(a.length, b.length);
  const res = [];

  for (let i = 0; i < length; i += 1) {
    res.push(a[i] ^ b[i]);
  }

  return Buffer.from(res).toString('base64');
}
function xor(a, b) {
  if (!Buffer.isBuffer(a)) a = Buffer.from(a);
  if (!Buffer.isBuffer(b)) b = Buffer.from(b);
  const length = Math.max(a.length, b.length);
  const res = [];

  for (let i = 0; i < length; i += 1) {
    res.push(a[i] ^ b[i]);
  }

  return Buffer.from(res).toString('base64');
}
function xor ( a , b ) { if ( ! Buffer . isBuffer ( a ) ) a = Buffer . from ( a ) ; if ( ! Buffer . isBuffer ( b ) ) b = Buffer . from ( b ) ; const length = Math . max ( a . length , b . length ) ; const res = [ ] ; for ( let i = 0 ; i < length ; i += 1 ) { res . push ( a [ i ] ^ b [ i ] ) ; } return Buffer . from ( res ) . toString ( 'base64' ) ; }
XOR two buffers
XOR two buffers