function xor(a, b) { a = Buffer.from(a, 'binary'); b = Buffer.from(b, 'binary'); var result = Buffer.allocUnsafe(a.length); for (var i = 0; i < a.length; i++) { result[i] = (a[i] ^ b[i]); } return result; }
function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case 'utf16le': this.text = utf16Text; this.end = utf16End; nb = 4; break; case 'utf8': this.fillLast = utf8FillLast; nb = 4; break; case 'base64': this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); }
var dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes);
sPadding = paramBytes - sLength; var dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength);