Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ExBuffer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ExBuffer - npm Package Compare versions

Comparing version 0.4.0 to 0.4.2

8

ExBuffer.js

@@ -9,3 +9,3 @@ /*!

* 构造方法
* @param bufferLength 缓存区长度,默认512 byte
* @param bufferLength 缓存区长度,默认8k
*/

@@ -16,3 +16,3 @@ var ExBuffer = function (bufferLength) {

var _endian = 'B';
var _buffer = new Buffer(bufferLength || 512);//Buffer大于8kb 会使用slowBuffer,效率低
var _buffer = new Buffer(bufferLength || 8192);
var _readOffset = 0;

@@ -115,4 +115,4 @@ var _putOffset = 0;

//buf.copy(targetBuffer, [targetStart], [sourceStart], [sourceEnd])
//当前缓冲区已经不能满足次数数据了
if(len + getLen() > _buffer.length){
//当前缓冲区已经不能满足次数数据了,这里我们保证尾部至少有一个位置永远空余,避免读写指针重叠
if(len + getLen() > _buffer.length - 1){
var ex = Math.ceil((len + getLen())/(1024));//每次扩展1kb

@@ -119,0 +119,0 @@ var tmp = new Buffer(ex * 1024);

@@ -9,3 +9,3 @@ {

"main" : "ExBuffer.js",
"version" : "0.4.0"
"version" : "0.4.2"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc