Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ethersproject/random

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/random

Random utility functions for ethers.

  • 5.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
794K
decreased by-10.91%
Maintainers
1
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 19 Aug 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc