web: switch from `crypto` to `SubtleCrypto`
Created by: valerybugakov
Context
It's a preparation for the Webpack 5 upgrade: https://github.com/sourcegraph/sourcegraph/pull/22580.
Webpack 5 removed automatic Node.js polyfills. To avoid adding polyfills to our bundle, we can switch to the client implementation of the SHA-256 algorithm. That's the only case when Node.js polyfill, specifically crypto
, is required for our web app.
Changes
- Switched from
crypto
to theSubtleCrypto
API for SHA-256 algorithm.