
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.
instance-memoizer
Advanced tools
instance-memoizer
A lingering object cache!
With instance-memoizer
you can cache object instances. Use the acquire
method to either create an object, or get an already created object from the cache. Then when you are done with the object, user the release
method to mark the object for destruction. You may also provide a linger period so the object is not detroyed in this period.
Acquiring an object will increase a counter. This counter is decreased when the object is released. When the counter is at 0 a timer is started. When the timer is done, the object is destroyed. Everytime the acquire method is used with the same arguments, the same object is returned.
Well if you have an object that is expensive to instantiate and you are using many times, you might want to use this. For instance network operations are often expensive in terms of time. Or maybe you are doing a really big computation, that is also a good use case for the instance-memoizer
.
instance-memoizer
Yeah I don't like it either. If you can come up with a better name, let me know!
import assert from "assert";
import { InstanceMemoizer } from "instance-memoizer";
const memoizer = new InstanceMemoizer(
() => Symbol(),
);
const a = memoizer.acquire();
const b = memoizer.acquire();
assert.equal(a, b);
memoizer.release(a)
memoizer.release(b)
const c = memoizer.acquire();
assert.notEqual(b, c);
memoizer.release(c);
FAQs
A lingering object cache!
The npm package instance-memoizer receives a total of 2 weekly downloads. As such, instance-memoizer popularity was classified as not popular.
We found that instance-memoizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.