
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Node.js non-blocking for ( ; ; ) loop for long running tasks.
Node.js is an asynchronous event driven framework for the V8 JavaScript engine. CPU-intensive task in your code will block the current thread of execution, including the event loop. Blocking the event loop can have catastrophic effects on the Node application.
Nothing.
This library tackles the use case where CPU-intensive code block is executed repetitively inside a loop.
$ npm install forloop
###forloop(initialization, limit, increment, iterationCallback, finalCallback)
Arguments
initialization
- Initial value for the counter variable.limit
- The final value of the counter to break the loop.increment
- The value to increment the counter variable.iterationCallback(i)
- A function to call on each itertation of the loop.
The current value of the counter variable is passed as the argument.finalCallback()
- A function, which is called when the loop exits.Calculating Golden Ratio
var count = 10000000;
var φ = 0;
for (var i = 0; i < count; i++) {
φ = Math.sqrt(φ + Math.sqrt(1));
}
console.log("φ ≈ %d", φ);
var forloop = require('forloop');
var count = 10000000;
var φ = 0;
forloop(0, count, 1,
function(i) {
φ = Math.sqrt(φ + Math.sqrt(1));
},
function() {
console.log("φ ≈ %d", φ);
}
);
$ npm test
FAQs
for ( ; ; ) loop for long async tasks
The npm package forloop receives a total of 0 weekly downloads. As such, forloop popularity was classified as not popular.
We found that forloop 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.