
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
Binary search on a Hypercore.
Pass a comparator. Gets you the index of the first block that matches, or -1 if not found.
npm install hisect
import hisect from 'hisect'
import Hypercore from 'hypercore'
import b4a from 'b4a'
const core = new Hypercore('./core')
await core.ready()
for (let i = 0; i <= 10000; i++) {
await core.append(b4a.from(`${i}`))
}
const since = 9999
const index = await hisect(core, since, (since, block) => {
const value = Number(b4a.toString(block))
if (value < since) return -1
if (value > since) return 1
return 0
})
console.log('Start index:', index)
Once you have the index, you can stream from it or do whatever.
const stream = core.createReadStream({ start: index })
for await (const data of stream) {
console.log(b4a.toString(data))
}
const index = await hisect(core, target, compare)
Does a binary search over the blocks in core. compare is a sync function that receives the block and should return:
< 0 if the target is after this block
> 0 if the target is before this block
0 if it's a match
Returns the index of the first matching block. If there's no match, returns -1.
hisect.ltehisect.lthisect.gtehisect.gtFAQs
Binary search for Hypercore
We found that hisect demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.