
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.
@x-oasis/prefix-interval-tree
Advanced tools
$ npm i @x-oasis/prefix-interval-tree
import PrefixIntervalTree from '@x-oasis/prefix-interval-tree'
$ pnpm test
const intervalTree = new PrefixIntervalTree([2,5,7])
const intervalTree = new PrefixIntervalTree(10)
Total interval tree array length is power of 2
, such as 8, 16, 32; and the input length value means the half size, which means 10
will result in 2^4 = 16
first, then patch on interval tree, it will be total 2 * 16 = 32
.
getHeap(): number[]
Basically, interval tree's size is this._half, they all have default 0
value. when you want to get the actual size which has been set with value, then call this method.
get(index: number): number
get the index value
set (index: number): boolean
To update the index value in interval tree, its parent will be updated as accordingly.
computeRange(minValue: number, maxValue: number): {
startIndex: number
endIndex: number
}
startIndex
: the biggest index less than or equal minValue;endIndex
: the smallest index greater than maxValue;when using the return value, endIndex item should not be included.
const arr = []
const intervalTree = new PrefixIntervalTree(arr)
const { startIndex, endIndex } = intervalTree.computeRange(100, 200);
const itemsInViewport = arr.slice(startIndex, endIndex)
FAQs
prefix interval tree function
The npm package @x-oasis/prefix-interval-tree receives a total of 28 weekly downloads. As such, @x-oasis/prefix-interval-tree popularity was classified as not popular.
We found that @x-oasis/prefix-interval-tree demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
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.