[ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
[ ] ๐ Bug fix (a non-breaking change that fixes an issue)
[ ] ๐ Enhancement (improving an existing functionality like performance)
[x] โจ New feature (a non-breaking change that adds functionality)
[ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
[ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
This PR adds all missing exports for node crypto shims to make sure it is compliant with Node.js types.
New methods are not implemented and will call an explicit runtime error if attempted to be called.
Note: Implementing the methods while possible, is not practical! A tree-shaked bundled version of browserify utils take ~550kb while with unenv with target modern runtimes (browser and workers) that all support crypto subtle. And new environments such as cloudflare workers and deno, offer their own runtime support for Node.js APIs.
Still (on a case by case basis) if there is a popular Node.js lib that needs some of them and there is a zero dep minimal implementation of some of them possible (optionally depending on web crypto and subtle crypto) it is more than welcome!
๐ Linked issue
Resolves #91
Related PR: #111
โ Type of change
๐ Description
This PR adds all missing exports for node crypto shims to make sure it is compliant with Node.js types.
New methods are not implemented and will call an explicit runtime error if attempted to be called.
Note: Implementing the methods while possible, is not practical! A tree-shaked bundled version of browserify utils take ~550kb while with unenv with target modern runtimes (browser and workers) that all support crypto subtle. And new environments such as cloudflare workers and deno, offer their own runtime support for Node.js APIs.
Still (on a case by case basis) if there is a popular Node.js lib that needs some of them and there is a zero dep minimal implementation of some of them possible (optionally depending on web crypto and subtle crypto) it is more than welcome!
๐ Checklist