
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
The end goal of this project is to implement the entire JavaScript Array.prototype
, and some
additional utility methods, as a circular buffer.
Note: This is called a circular buffer because of what this library accomplishes, but is implemented as an Array. This may be confusing for Node users, which may want to use a true Buffer.
As JavaScript is used for more and more computationally intensive tasks, it's important to reduce execution and garbage collection time. By using a circular buffer instead of a native array less extraneous data bits are generated that will need to be cleaned up later. So use of this library is two fold: First, if you need a circular buffer for the classical reasons (animation queue, video streaming) this library can help you out. Second, if you know the maximum size of an array you'll be working with, using CBuffer can drastically reduce the memory footprint of your application.
While the entire Array.prototype
API is on the roadmap, it's not all quite here. Below is the
currently implemented API.
It's simple. Just use it like you would use an Array.
new CBuffer(10); // empty buffer with length of 10
new CBuffer(1,2,3,4); // buffer with length 4
CBuffer(5); // For those who are really lazy, new is optional
Included are several non-standard niceties. Like if you want to catch when data is overwritten,
just assign a function to the overflow
variable and it will be called whenever a value is about
to be overwritten and it will pass the value as the first argument:
var myBuff = CBuffer(4);
myBuff.overflow = function(data) {
console.log(data);
};
myBuff.push(1,2,3,4); // nothing shows up yet
myBuff.push(5); // log: 1
Array.length = 0
.FAQs
Circular Buffer JavaScript implementation
The npm package CBuffer receives a total of 8,361 weekly downloads. As such, CBuffer popularity was classified as popular.
We found that CBuffer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.