What documentation change is needed?
Cloudflare Workers supports Web Standard APIs first, but many developers copy Node.js examples for hashing, signing, random bytes, or key generation and expect them to work unchanged in Workers.
The docs cover APIs individually, but it is still easy to miss that crypto.subtle in Workers is not the same usage pattern as Node's crypto module, and that examples written for Node often fail or require adaptation.
A short clarification page or note in the Workers docs would help prevent confusion when developers move code from Node.js tutorials or npm package examples into Workers.
What problem does this solve?
A common source of confusion is code like this:
- Node.js examples using
createHash, createHmac, randomBytes, or createSign
- assumptions that
Buffer-based examples work unchanged
- expectations that all
crypto examples found online apply directly to Workers runtime
In Workers, developers often need to use:
- Web Crypto APIs such as
crypto.subtle.digest()
TextEncoder / TextDecoder
- Workers-compatible libraries or compatibility settings where relevant
Without a clear note, this can lead to trial-and-error debugging and the impression that Workers crypto support is incomplete, when the actual issue is API mismatch.
Suggested improvement
Please add a documentation note or guide that clearly explains:
- Workers primarily uses Web Crypto / web-standard runtime APIs
- Node.js
crypto examples often need adjustment before they work in Workers
- a few side-by-side examples for common tasks:
- SHA-256 hashing
- HMAC signing
- secure random value generation
- when Node compatibility features help, and when they still do not make all Node examples portable as-is
Where should this appear?
Possible locations:
- Workers runtime API docs
- Node.js compatibility docs for Workers
- a troubleshooting or migration guide for "moving Node code to Workers"
Additional context
This would be especially helpful for developers migrating server-side code or using package documentation that assumes a full Node.js runtime.
What documentation change is needed?
Cloudflare Workers supports Web Standard APIs first, but many developers copy Node.js examples for hashing, signing, random bytes, or key generation and expect them to work unchanged in Workers.
The docs cover APIs individually, but it is still easy to miss that
crypto.subtlein Workers is not the same usage pattern as Node'scryptomodule, and that examples written for Node often fail or require adaptation.A short clarification page or note in the Workers docs would help prevent confusion when developers move code from Node.js tutorials or npm package examples into Workers.
What problem does this solve?
A common source of confusion is code like this:
createHash,createHmac,randomBytes, orcreateSignBuffer-based examples work unchangedcryptoexamples found online apply directly to Workers runtimeIn Workers, developers often need to use:
crypto.subtle.digest()TextEncoder/TextDecoderWithout a clear note, this can lead to trial-and-error debugging and the impression that Workers crypto support is incomplete, when the actual issue is API mismatch.
Suggested improvement
Please add a documentation note or guide that clearly explains:
cryptoexamples often need adjustment before they work in WorkersWhere should this appear?
Possible locations:
Additional context
This would be especially helpful for developers migrating server-side code or using package documentation that assumes a full Node.js runtime.