HomePhabricator
Diffusion Comm c2af4d6d0486

Reimplement generateRandomString using browser crypto module

Description

Reimplement generateRandomString using browser crypto module

Summary:
generateRandomString is currently implemented using a polyfill of the Node.js crypto library, but Webpack 5 no longer includes this polyfill by default.

We could configure the polyfill manually, but instead I figured we could save some bundle size and just reimplement this using the browser-native crypto module, which has a getRandomValues function.

Test Plan: console.log'd the results of calling generateDeviceID in web

Reviewers: inka, atul, tomek

Reviewed By: atul

Differential Revision: https://phab.comm.dev/D6697

Details

Provenance
ashoatAuthored on Feb 12 2023, 7:54 AM
Reviewer
atul
Differential Revision
D6697: Reimplement generateRandomString using browser crypto module
Parents
rCOMMdc2f711faf30: [lib] Update assets-webpack-plugin to 5.1.2
Branches
Unknown
Tags
Unknown