Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
chop-stream
Advanced tools
Chop a data stream into fixed size buffer chunks. Written in ES2015.
$ npm install chop-stream
const ChopStream = require('chop-stream')
const chop = new ChopStream({ size: 8, padding: true })
chop.on('data', (chunk) => console.log(chunk))
process.stdin.pipe(chop)
<Buffer 61 62 63 64 65 66 67 68>
<Buffer 69 6a 6b 6c 6d 6e 6f 70>
<Buffer 71 72 73 74 75 76 77 78>
<Buffer 79 7a 0a 00 00 00 00 00>
See the examples folder for more details on how to customize the animation.
ChopStream is a node Transform stream.
chop = new ChopStream(size, options = { padding: false, size: 1024 })
size
: size of output chunks. Can be omitted and set in options instead.
padding
: pad the end of a stream with zeroes to align the last chunk.
Has this not been done before?
Sure, here are a few examples:
A few? Did we really need yet another module?
Probably not, but I wanted a small dependency-free ES2015 version.
Why open a pull request, when you can follow the trend and add yet another module.
FAQs
Chop a data stream into fixed size buffer chunks
The npm package chop-stream receives a total of 2 weekly downloads. As such, chop-stream popularity was classified as not popular.
We found that chop-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.