You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

randomfill

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randomfill

random fill from browserify stand alone


Version published
Maintainers
1
Install size
46.7 kB
Created

Package description

What is randomfill?

The randomfill npm package is a utility that provides methods to fill a buffer with random bytes. This package is particularly useful when you need to generate random data for cryptographic purposes, such as creating keys, salts, or nonces in security-related applications.

What are randomfill's main functionalities?

Filling a buffer with random bytes

This feature allows you to fill a pre-allocated buffer with random bytes. The function takes a buffer and a callback function as arguments. The callback function is called with any error and the filled buffer.

const randomFill = require('randomfill');
const buffer = Buffer.alloc(10); // create a buffer of 10 bytes
randomFill.randomFill(buffer, function(err, buf) {
  if (err) throw err;
  console.log(buf); // Outputs the buffer filled with random bytes
});

Other packages similar to randomfill

Readme

Source

randomfill

Version

randomfill from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues

var randomFill = require('randomfill');
var buf
randomFill.randomFillSync(16);//get 16 random bytes
randomFill.randomFill(16, function (err, resp) {
  // resp is 16 random bytes
});

Keywords

FAQs

Package last updated on 16 Feb 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc