<commit_before>// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest

var Packet = require('../packets/packet');

function AuthSwitchRequestMoreData (data)
{
  this.data = data;
}

AuthSwitchRequestMoreData.prototype.toPacket = function ()
{
  var length = 5 + this.data.length;
  var buffer = new Buffer(length).fill(0);
  var packet = new Packet(0, buffer, 0, length);
  packet.offset = 4;
  packet.writeInt8(0x01);
  packet.writeBuffer(this.data);
  return packet;
};

AuthSwitchRequestMoreData.fromPacket = function (packet)
{
  var marker = packet.readInt8();
  var data = packet.readBuffer();
  return new AuthSwitchRequestMoreData(data);
};

AuthSwitchRequestMoreData.verifyMarker = function (packet) {
  return (packet.peekByte() == 0x01);
};
<commit_msg>node 0.10: buffer.fill() does not return ref to buffer<commit_after>// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest

var Packet = require('../packets/packet');

function AuthSwitchRequestMoreData (data)
{
  this.data = data;
}

AuthSwitchRequestMoreData.prototype.toPacket = function ()
{
  var length = 5 + this.data.length;
  var buffer = new Buffer(length);
  var packet = new Packet(0, buffer, 0, length);
  packet.offset = 4;
  packet.writeInt8(0x01);
  packet.writeBuffer(this.data);
  return packet;
};

AuthSwitchRequestMoreData.fromPacket = function (packet)
{
  var marker = packet.readInt8();
  var data = packet.readBuffer();
  return new AuthSwitchRequestMoreData(data);
};

AuthSwitchRequestMoreData.verifyMarker = function (packet) {
  return (packet.peekByte() == 0x01);
};

{'fraction_non_alphanumeric': 0.1371016235718581, 'fraction_numerical': 0.01683704149128082, 'mean_word_length': 4.942857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4143006', 'n_tokens_mistral': 549, 'n_tokens_neox': 530, 'n_words': 110}