Lines Matching refs:buf

6388       var buf = Buffer.alloc(this.iWrite - this.iRead);
6389 this.buffer.copy(buf, 0, this.iRead, this.iWrite);
6390 return buf;
6395 var buf; // read size bytes from buffer and return buffer
6404 buf = this.toBuffer();
6406 return buf;
6410 buf = Buffer.alloc(size);
6411 this.buffer.copy(buf, 0, this.iRead, size);
6413 return buf;
6501 var buf = new ReadWriteBuf(this.bufSize);
6502 this.buffers.push(buf);
6503 return buf;
6724 buffers = this.buffers.map(function (buf) {
6725 return buf.toBuffer();
6827 var buf = Buffer.alloc(size);
6829 this._buf.copy(buf, 0);
6831 this._buf = buf;
29423 var buf = DEREncoder.prototype.encode.call(this, data);
29424 var p = buf.toString('base64');
36687 function asUInt32Array(buf) {
36688 if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
36689 var len = buf.length / 4 | 0;
36693 out[i] = buf.readUInt32BE(i * 4);
36862 var buf = Buffer.allocUnsafe(16);
36863 buf.writeUInt32BE(out[0], 0);
36864 buf.writeUInt32BE(out[1], 4);
36865 buf.writeUInt32BE(out[2], 8);
36866 buf.writeUInt32BE(out[3], 12);
36867 return buf;
36877 var buf = Buffer.allocUnsafe(16);
36878 buf.writeUInt32BE(out[0], 0);
36879 buf.writeUInt32BE(out[3], 4);
36880 buf.writeUInt32BE(out[2], 8);
36881 buf.writeUInt32BE(out[1], 12);
36882 return buf;
37015 StreamCipher.prototype.setAAD = function setAAD(buf) {
37018 this._ghash.update(buf);
37020 this._alen += buf.length;
37317 function toArray(buf) {
37318 return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)];
37322 var buf = Buffer.allocUnsafe(16);
37323 buf.writeUInt32BE(out[0] >>> 0, 0);
37324 buf.writeUInt32BE(out[1] >>> 0, 4);
37325 buf.writeUInt32BE(out[2] >>> 0, 8);
37326 buf.writeUInt32BE(out[3] >>> 0, 12);
37327 return buf;
37382 GHASH.prototype.update = function (buf) {
37383 this.cache = Buffer.concat([this.cache, buf]);
38696 var buf = Buffer(size);
38700 buf.fill(fill, encoding);
38702 buf.fill(fill);
38705 buf.fill(0);
38708 return buf;
38810 var buf = new Uint8Array(length);
38811 buf.__proto__ = Buffer.prototype;
38812 return buf;
38970 var buf = createBuffer(length);
38971 var actual = buf.write(string, encoding);
38977 buf = buf.slice(0, actual);
38980 return buf;
38985 var buf = createBuffer(length);
38988 buf[i] = array[i] & 255;
38991 return buf;
39003 var buf;
39006 buf = new Uint8Array(array);
39008 buf = new Uint8Array(array, byteOffset);
39010 buf = new Uint8Array(array, byteOffset, length);
39014 buf.__proto__ = Buffer.prototype;
39015 return buf;
39021 var buf = createBuffer(len);
39023 if (buf.length === 0) {
39024 return buf;
39027 obj.copy(buf, 0, 0, len);
39028 return buf;
39135 var buf = list[i];
39137 if (isInstance(buf, Uint8Array)) {
39138 buf = Buffer.from(buf);
39141 if (!Buffer.isBuffer(buf)) {
39145 buf.copy(buffer, pos);
39146 pos += buf.length;
39512 function read(buf, i) {
39514 return buf[i];
39516 return buf.readUInt16BE(i * indexSize);
39566 function hexWrite(buf, string, offset, length) {
39568 var remaining = buf.length - offset;
39589 buf[offset + i] = parsed;
39595 function utf8Write(buf, string, offset, length) {
39596 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
39599 function asciiWrite(buf, string, offset, length) {
39600 return blitBuffer(asciiToBytes(string), buf, offset, length);
39603 function latin1Write(buf, string, offset, length) {
39604 return asciiWrite(buf, string, offset, length);
39607 function base64Write(buf, string, offset, length) {
39608 return blitBuffer(base64ToBytes(string), buf, offset, length);
39611 function ucs2Write(buf, string, offset, length) {
39612 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
39690 function base64Slice(buf, start, end) {
39691 if (start === 0 && end === buf.length) {
39692 return base64.fromByteArray(buf);
39694 return base64.fromByteArray(buf.slice(start, end));
39698 function utf8Slice(buf, start, end) {
39699 end = Math.min(buf.length, end);
39704 var firstByte = buf[i];
39720 secondByte = buf[i + 1];
39733 secondByte = buf[i + 1];
39734 thirdByte = buf[i + 2];
39747 secondByte = buf[i + 1];
39748 thirdByte = buf[i + 2];
39749 fourthByte = buf[i + 3];
39804 function asciiSlice(buf, start, end) {
39806 end = Math.min(buf.length, end);
39809 ret += String.fromCharCode(buf[i] & 0x7F);
39815 function latin1Slice(buf, start, end) {
39817 end = Math.min(buf.length, end);
39820 ret += String.fromCharCode(buf[i]);
39826 function hexSlice(buf, start, end) {
39827 var len = buf.length;
39833 out += toHex(buf[i]);
39839 function utf16leSlice(buf, start, end) {
39840 var bytes = buf.slice(start, end);
40039 function checkInt(buf, value, offset, ext, max, min) {
40040 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
40042 if (offset + ext > buf.length) throw new RangeError('Index out of range');
40235 function checkIEEE754(buf, value, offset, ext, max, min) {
40236 if (offset + ext > buf.length) throw new RangeError('Index out of range');
40240 function writeFloat(buf, value, offset, littleEndian, noAssert) {
40245 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);
40248 ieee754.write(buf, value, offset, littleEndian, 23, 4);
40260 function writeDouble(buf, value, offset, littleEndian, noAssert) {
40265 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);
40268 ieee754.write(buf, value, offset, littleEndian, 52, 8);
43715 var buf = new Buffer(bn);
43717 if (len && buf.length < len) {
43718 var zeros = new Buffer(len - buf.length);
43720 buf = Buffer.concat([zeros, buf]);
43724 return buf;
43726 return buf.toString(enc);
45462 var buf = new Buffer(bn.toArray());
45465 return buf;
45467 return buf.toString(enc);
47903 function getLength(buf, p) {
47904 var initial = buf[p.place++];
47920 val |= buf[off];
47933 function rmPadding(buf) {
47935 var len = buf.length - 1;
47937 while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {
47942 return buf;
47945 return buf.slice(i);
50287 function sum64(buf, pos, ah, al) {
50288 var bh = buf[pos];
50289 var bl = buf[pos + 1];
50292 buf[pos] = hi >>> 0;
50293 buf[pos + 1] = lo;
50958 function crc32(crc, buf, len, pos) {
50964 crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 0xFF];
52046 var buf = new Buffer(size);
52047 buf.fill(0);
52048 return buf;
53683 var buf,
53708 buf = new Uint8Array(buf_len);
53710 buf = new Array(buf_len);
53728 buf[i++] = c;
53731 buf[i++] = 0xC0 | c >>> 6;
53732 buf[i++] = 0x80 | c & 0x3f;
53735 buf[i++] = 0xE0 | c >>> 12;
53736 buf[i++] = 0x80 | c >>> 6 & 0x3f;
53737 buf[i++] = 0x80 | c & 0x3f;
53740 buf[i++] = 0xf0 | c >>> 18;
53741 buf[i++] = 0x80 | c >>> 12 & 0x3f;
53742 buf[i++] = 0x80 | c >>> 6 & 0x3f;
53743 buf[i++] = 0x80 | c & 0x3f;
53747 return buf;
53756 var utf8border = function utf8border(buf, max) {
53758 max = max || buf.length;
53760 if (max > buf.length) {
53761 max = buf.length;
53767 while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) {
53783 return pos + _utf8len[buf[pos]] > max ? pos : max;
53787 var buf2string = function buf2string(buf) {
53789 var len = buf.length; // Reserve max possible length (2 words per char)
53796 c = buf[i++]; // quick process ascii
53815 c = c << 6 | buf[i++] & 0x3f;
53870 exports.utf8decode = function utf8decode(buf) {
53872 return utils.transformTo("nodebuffer", buf).toString("utf-8");
53875 buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf);
53876 return buf2string(buf);
62631 exports.shrinkBuf = function (buf, size) {
62632 if (buf.length === size) {
62633 return buf;
62636 if (buf.subarray) {
62637 return buf.subarray(0, size);
62640 buf.length = size;
62641 return buf;
62747 var buf,
62771 buf = new utils.Buf8(buf_len); // convert
62787 buf[i++] = c;
62790 buf[i++] = 0xC0 | c >>> 6;
62791 buf[i++] = 0x80 | c & 0x3f;
62794 buf[i++] = 0xE0 | c >>> 12;
62795 buf[i++] = 0x80 | c >>> 6 & 0x3f;
62796 buf[i++] = 0x80 | c & 0x3f;
62799 buf[i++] = 0xf0 | c >>> 18;
62800 buf[i++] = 0x80 | c >>> 12 & 0x3f;
62801 buf[i++] = 0x80 | c >>> 6 & 0x3f;
62802 buf[i++] = 0x80 | c & 0x3f;
62806 return buf;
62810 function buf2binstring(buf, len) {
62815 if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {
62816 return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
62823 result += String.fromCharCode(buf[i]);
62830 exports.buf2binstring = function (buf) {
62831 return buf2binstring(buf, buf.length);
62836 var buf = new utils.Buf8(str.length);
62838 for (var i = 0, len = buf.length; i < len; i++) {
62839 buf[i] = str.charCodeAt(i);
62842 return buf;
62846 exports.buf2string = function (buf, max) {
62848 var len = max || buf.length; // Reserve max possible length (2 words per char)
62855 c = buf[i++]; // quick process ascii
62874 c = c << 6 | buf[i++] & 0x3f;
62902 exports.utf8border = function (buf, max) {
62904 max = max || buf.length;
62906 if (max > buf.length) {
62907 max = buf.length;
62913 while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) {
62929 return pos + _utf8len[buf[pos]] > max ? pos : max;
62955 function adler32(adler, buf, len, pos) {
62968 s1 = s1 + buf[pos++] | 0;
63090 function crc32(crc, buf, len, pos) {
63096 crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 0xFF];
63244 function zero(buf) {
63245 var len = buf.length;
63248 buf[len] = 0;
63316 function read_buf(strm, buf, start, size) {
63329 utils.arraySet(buf, strm.input, strm.next_in, len, start);
63332 strm.adler = adler32(strm.adler, buf, len, start);
63334 strm.adler = crc32(strm.adler, buf, len, start);
68401 function zero(buf) {
68402 var len = buf.length;
68405 buf[len] = 0;
69055 function copy_block(s, buf, len, header) //DeflateState *s;
69071 utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
69693 function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s;
69701 copy_block(s, buf, stored_len, true);
69721 function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s;
69773 if (stored_len + 4 <= opt_lenb && buf !== -1) {
69782 _tr_stored_block(s, buf, stored_len, last);
70803 exports.privateEncrypt = function privateEncrypt(key, buf) {
70804 return exports.publicEncrypt(key, buf, true);
70807 exports.publicDecrypt = function publicDecrypt(key, buf) {
70808 return exports.privateDecrypt(key, buf, true);
71232 function randomFill(buf, offset, size, cb) {
71233 if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
71240 size = buf.length;
71243 size = buf.length - offset;
71248 assertOffset(offset, buf.length);
71249 assertSize(size, offset, buf.length);
71250 return actualFill(buf, offset, size, cb);
71253 function actualFill(buf, offset, size, cb) {
71255 var ourBuf = buf.buffer;
71261 cb(null, buf);
71266 return buf;
71275 bytes.copy(buf, offset);
71276 cb(null, buf);
71282 bytes.copy(buf, offset);
71283 return buf;
71286 function randomFillSync(buf, offset, size) {
71291 if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {
71295 assertOffset(offset, buf.length);
71296 if (size === undefined) size = buf.length - offset;
71297 assertSize(size, offset, buf.length);
71298 return actualFill(buf, offset, size);
74110 var buf = p.data;
74111 var nb = n > buf.length ? buf.length : n;
74112 buf.copy(ret, ret.length - n, 0, nb);
74116 if (nb === buf.length) {
74121 p.data = buf.slice(nb);
75434 var buf = Buffer(size);
75438 buf.fill(fill, encoding);
75440 buf.fill(fill);
75443 buf.fill(0);
75446 return buf;
75518 var buf = Buffer(size);
75521 buf.fill(0);
75523 buf.fill(fill, encoding);
75525 buf.fill(fill);
75528 return buf;
80160 var buf = p.data;
80161 var nb = n > buf.length ? buf.length : n;
80162 buf.copy(ret, ret.length - n, 0, nb);
80166 if (nb === buf.length) {
80171 p.data = buf.slice(nb);
81437 StringDecoder.prototype.write = function (buf) {
81438 if (buf.length === 0) return '';
81443 r = this.fillLast(buf);
81451 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
81459 StringDecoder.prototype.fillLast = function (buf) {
81460 if (this.lastNeed <= buf.length) {
81461 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
81465 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
81466 this.lastNeed -= buf.length;
81479 function utf8CheckIncomplete(self, buf, i) {
81480 var j = buf.length - 1;
81482 var nb = utf8CheckByte(buf[j]);
81490 nb = utf8CheckByte(buf[j]);
81498 nb = utf8CheckByte(buf[j]);
81519 function utf8CheckExtraBytes(self, buf, p) {
81520 if ((buf[0] & 0xC0) !== 0x80) {
81525 if (self.lastNeed > 1 && buf.length > 1) {
81526 if ((buf[1] & 0xC0) !== 0x80) {
81531 if (self.lastNeed > 2 && buf.length > 2) {
81532 if ((buf[2] & 0xC0) !== 0x80) {
81541 function utf8FillLast(buf) {
81543 var r = utf8CheckExtraBytes(this, buf, p);
81546 if (this.lastNeed <= buf.length) {
81547 buf.copy(this.lastChar, p, 0, this.lastNeed);
81551 buf.copy(this.lastChar, p, 0, buf.length);
81552 this.lastNeed -= buf.length;
81558 function utf8Text(buf, i) {
81559 var total = utf8CheckIncomplete(this, buf, i);
81560 if (!this.lastNeed) return buf.toString('utf8', i);
81562 var end = buf.length - (total - this.lastNeed);
81563 buf.copy(this.lastChar, 0, end);
81564 return buf.toString('utf8', i, end);
81569 function utf8End(buf) {
81570 var r = buf && buf.length ? this.write(buf) : '';
81579 function utf16Text(buf, i) {
81580 if ((buf.length - i) % 2 === 0) {
81581 var r = buf.toString('utf16le', i);
81589 this.lastChar[0] = buf[buf.length - 2];
81590 this.lastChar[1] = buf[buf.length - 1];
81600 this.lastChar[0] = buf[buf.length - 1];
81601 return buf.toString('utf16le', i, buf.length - 1);
81606 function utf16End(buf) {
81607 var r = buf && buf.length ? this.write(buf) : '';
81617 function base64Text(buf, i) {
81618 var n = (buf.length - i) % 3;
81619 if (n === 0) return buf.toString('base64', i);
81624 this.lastChar[0] = buf[buf.length - 1];
81626 this.lastChar[0] = buf[buf.length - 2];
81627 this.lastChar[1] = buf[buf.length - 1];
81630 return buf.toString('base64', i, buf.length - n);
81633 function base64End(buf) {
81634 var r = buf && buf.length ? this.write(buf) : '';
81640 function simpleWrite(buf) {
81641 return buf.toString(this.encoding);
81644 function simpleEnd(buf) {
81645 return buf && buf.length ? this.write(buf) : '';
83028 function v1(options, buf, offset) {
83029 var i = buf && offset || 0;
83030 var b = buf || new Array(16);
83105 return buf || (0, _stringify.default)(b);
83170 function generateUUID(value, namespace, buf, offset) {
83193 if (buf) {
83197 buf[offset + i] = bytes[i];
83200 return buf;
83235 function v4(options, buf, offset) {
83244 if (buf) {
83248 buf[offset + i] = rnds[i];
83251 return buf;