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.
torrent-piece
Advanced tools
Also works in the browser with browserify! This module is used by WebTorrent and torrent-stream.
npm install torrent-piece
import Piece from 'torrent-piece'
Piece.BLOCK_LENGTH // 16384
const pieceLength = Piece.BLOCK_LENGTH * 5
const piece = new Piece(pieceLength)
piece.missing // 81920
piece.reserve() // 0
piece.set(0, someBuffer0)
piece.reserve() // 1
piece.reserve() // 2
piece.reserve() // 3
piece.set(1, someBuffer1)
piece.set(2, someBuffer2)
piece.set(3, someBuffer3)
piece.reserve() // 4
piece.cancel(4) // cancel the reservation of a chunk
piece.reserve() // 4 (given out again)
piece.set(4, someBuffer4)
// handy functions
piece.chunkLength(0) // 16384
piece.chunkOffset(0) // 0
// eventually, when no more chunks left...
piece.reserve() // -1 (signal that all chunks are reserved)
piece.missing // 0
const pieceBuffer = piece.flush()
console.log(pieceBuffer)
MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.
FAQs
Torrent piece abstraction
The npm package torrent-piece receives a total of 3,948 weekly downloads. As such, torrent-piece popularity was classified as popular.
We found that torrent-piece demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
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.