Socket
Socket
Sign inDemoInstall

@aws-crypto/random-source-browser

Package Overview
Dependencies
3
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.


Version published
Weekly downloads
1.7K
decreased by-17.35%
Maintainers
8
Install size
148 kB
Created
Weekly downloads
 

Changelog

Source

5.2.0 (2023-10-16)

Features

  • support ESM artifacts in all packages (#752) (e930ffb)

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.

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 16 Oct 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