Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/decred/dcrd/lru
Package lru implements generic least-recently-used caches with near O(1) perf.
A least-recently-used (LRU) cache is a cache that holds a limited number of items with an eviction policy such that when the capacity of the cache is exceeded, the least-recently-used item is automatically removed when inserting a new item. The meaning of used in this implementation is either accessing the item via a lookup or adding the item into the cache, including when the item already exists.
This package has intentionally been designed so it can be used as a standalone package for any projects needing to make use of well-tested and concurrent safe least-recently-used caches with near O(1) performance characteristics for lookups, inserts, and deletions.
This package is part of the github.com/decred/dcrd/lru
module. Use the
standard go tooling for working with modules to incorporate it.
Basic Cache Usage Demonstrates creating a new cache instance, inserting items into the cache, causing an eviction of the least-recently-used item, and removing an item.
Basic KV Cache Usage Demonstrates creating a new k/v cache instance, inserting items into the cache, causing an eviction of the least-recently-used item, and removing an item.
Package lru is licensed under the copyfree ISC License.
FAQs
Unknown package
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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.