Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

@aws-crypto/random-source-browser

Package Overview
Dependencies
4
Maintainers
8
Versions
12
Issues
File Explorer

Advanced tools

@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.

    4.0.0latest
    GitHub
    npm

Version published
Maintainers
8
Weekly downloads
1,075
decreased by-71.16%

Weekly downloads

Changelog

Source

4.0.0 (2023-02-20)

  • feat!: deprecate node12. (d85ca33)

BREAKING CHANGES

  • Remove node12 from CI (#543)

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 installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
Socket SOC 2 Logo

Product

  • Package Issues
  • 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