Socket
Socket
Sign inDemoInstall

@lukeed/csprng

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lukeed/csprng

An alias package for `crypto.randomBytes` in Node.js and/or browsers


Version published
Weekly downloads
3.9M
increased by8.26%
Maintainers
1
Weekly downloads
 
Created

What is @lukeed/csprng?

@lukeed/csprng is a lightweight and fast library for generating cryptographically secure random numbers. It is designed to be simple and efficient, making it suitable for use in various applications where secure random number generation is required.

What are @lukeed/csprng's main functionalities?

Generate a random number

This feature allows you to generate a cryptographically secure random number of a specified byte length. The example code generates a 16-byte random number and logs it to the console.

const { random } = require('@lukeed/csprng');
const randomNumber = random(16); // Generates a 16-byte random number
console.log(randomNumber);

Generate a random number with a specific length

This feature allows you to specify the length of the random number in bytes. The example code generates a 32-byte random number and logs it to the console.

const { random } = require('@lukeed/csprng');
const randomNumber = random(32); // Generates a 32-byte random number
console.log(randomNumber);

Other packages similar to @lukeed/csprng

Keywords

FAQs

Package last updated on 31 Mar 2023

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc