Socket
Socket
Sign inDemoInstall

@aws-crypto/random-source-browser

Package Overview
Dependencies
4
Maintainers
8
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/random-source-browser

Access to a secure random source in a browser. `Math.random` is not acceptable for cryptographic operations. This module exports a consistent interface for modern browsers and IE11.


Version published
Maintainers
8
Weekly downloads
1,832
decreased by-8.86%

Weekly downloads

Readme

Source

@aws-crypto/random-source-browser

Access to a secure random source in a browser. Math.random is not acceptable for cryptographic operations. This module exports a consistent interface for modern browsers and IE11.

Usage

import {randomValues, randomValuesOnly} from '@aws-crypto/random-source-browser'

const seedData2 = await randomValues(16);
const seedData1 = await randomValuesOnly(16);

randomValues vs randomValuesOnly

Some browsers only implement crypto.getRandomValues and not crypto.subtle. If you need to have access to both, you should use randomValues. But if you want to use some cryptographic fallback like MSRCrypto randomValuesOnly is the preferred function.

Test

npm test

FAQs

Last updated on 20 Feb 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc