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.
random-poly-fill
Advanced tools
A polyfill for crypto.randomFill and crypto.randomFillSync from Node.js core
A polyfill for crypto.randomFill
and crypto.randomFillSync
from
Node.js core.
These two functions were added in Node.js v6.13.0. Use this polyfill if you need to use these function in older versions of Node.js.
This polyfill is not optimized for speed or low resource usage. If you
can, use crypto.randomBytes
directly instead.
npm install random-poly-fill --save
const { randomFill, randomFillSync } = require('random-poly-fill')
const source = Buffer.alloc(10)
randomFill(source, 0, 5, function (err, target) {
if (err) throw err
console.log(source.toString('hex')) // fc4584c64a0000000000
console.log(target.toString('hex')) // fc4584c64a0000000000
})
const buf = Buffer.alloc(10)
randomFillSync(buf, 5, 5)
console.log(buf.toString('hex')) // 0000000000bcc09d5877
crypto.randomFill(buffer[, offset][, size], callback)
See Node.js core documentation for crypto.randomFill
.
crypto.randomFillSync(buffer[, offset][, size])
See Node.js core documentation for crypto.randomFillSync
.
FAQs
A polyfill for crypto.randomFill and crypto.randomFillSync from Node.js core
The npm package random-poly-fill receives a total of 18,017 weekly downloads. As such, random-poly-fill popularity was classified as popular.
We found that random-poly-fill 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.
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.