Socket
Socket
Sign inDemoInstall

@ethersproject/random

Package Overview
Dependencies
2
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/random

Random utility functions for ethers.


Version published
Weekly downloads
710K
increased by8.27%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @ethersproject/random?

@ethersproject/random is a part of the ethers.js library, which provides utilities for generating cryptographically secure random values. This is particularly useful in blockchain and cryptographic applications where secure randomness is crucial.

What are @ethersproject/random's main functionalities?

Generate Random Bytes

Generates a cryptographically secure random sequence of bytes. The number of bytes is specified as an argument to the function.

const { randomBytes } = require('@ethersproject/random');
const bytes = randomBytes(16);
console.log(bytes);

Generate Random Hex String

Generates a cryptographically secure random sequence of bytes and converts it to a hexadecimal string.

const { randomBytes } = require('@ethersproject/random');
const bytes = randomBytes(16);
const hexString = bytes.toString('hex');
console.log(hexString);

Other packages similar to @ethersproject/random

Readme

Source

Random Value Utilities

This sub-module is part of the ethers project.

It contains functions to assist with random numbers.

For more information, see the documentation.

Importing

Most users will prefer to use the umbrella package, but for those with more specific needs, individual components can be imported.

const {

    shuffled,

    randomBytes

} = require("@ethersproject/random");

License

MIT License

Keywords

FAQs

Last updated on 24 May 2022

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc