mirror of
https://github.com/vale981/apollo-server
synced 2025-03-04 17:21:42 -05:00
![]() The apollo-server-core package uses Node's built-in crypto module only to create SHA-256 and -512 hashes. When we're actually running in Node, the native crypto library is clearly the best way to create these hashes, not least because we can assume it will be available without having to bundle it first. Outside of Node (such as in React Native apps), bundlers tend to fall back on the crypto-browserify polyfill, which comprises more than a hundred separate modules. Importing this polyfill at runtime (likely during application startup) takes precious time and memory, even though almost all of it is unused. Since we only need to create SHA hashes, we can import the much smaller sha.js library in non-Node environments, which happens to be what crypto-browserify uses for SHA hashing, and is a widely used npm package in its own right: https://www.npmjs.com/package/sha.js. |
||
---|---|---|
.. | ||
apollo-cache-control | ||
apollo-datasource | ||
apollo-datasource-rest | ||
apollo-engine-reporting | ||
apollo-engine-reporting-protobuf | ||
apollo-graphql | ||
apollo-server | ||
apollo-server-azure-functions | ||
apollo-server-cache-memcached | ||
apollo-server-cache-redis | ||
apollo-server-caching | ||
apollo-server-cloud-functions | ||
apollo-server-cloudflare | ||
apollo-server-core | ||
apollo-server-env | ||
apollo-server-errors | ||
apollo-server-express | ||
apollo-server-hapi | ||
apollo-server-integration-testsuite | ||
apollo-server-koa | ||
apollo-server-lambda | ||
apollo-server-micro | ||
apollo-server-plugin-base | ||
apollo-server-testing | ||
apollo-tracing | ||
graphql-extensions |