Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
github.com/rp-3/gheap
heap := gheap.NewHeap(-1) // unbounded size
// add anything you want to the heap
type itemToHeapify struct {
// any properties you want
}
// so long as it conforms to the orderable interface, which looks like this:
type Orderable interface {
// Order dictates the internal ordering of the items in the heap. Heap is
// min-ordered, so lowest-order items have the highest priority
Order() int
}
// make your itemToHeapify conform to the interface by adding a method named
// `Order`, like this:
func (i itemToHeapify) Order int {
// Returns the relative order of this item as an int
}
// 1. make sure you're conforming to the protocol
type itemToHeapify struct {
key int
val []byte // use whatever you want
}
func (i itemToHeapify) Order int {
return i.key
}
// 2. create a heap
heap := gheap.NewHeap(-1) // unbounded size
// 3. Push and Pop at will
a, ok := heap.Push(itemToHeapify{ key: 1, val: []byte{} })
b, ok := heap.Pop()
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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.