Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use node: specifier for crypto import #97

Closed
wants to merge 1 commit into from

Conversation

alexgleason
Copy link

Improves Deno support.

So, I see you're overhauling this library in #92, but I figured I'd submit this anyway so you can see the diff.

Importing node:crypto is supported in both Deno and Node.js as far back as v14.18.0 (the oldest supported LTS). And it simplifies things for Deno users a lot.

In #92 you could still require('node:crypto') to get the same advantages. Although... I think Deno might take the web APIs in that case anyway(?)

@paulmillr
Copy link
Owner

Great! v2.0 is behind the corner -- however, I could reuse this in noble-crypto / hashes. Will need to test deno with them.

@paulmillr
Copy link
Owner

Not great — big issues in hashes/curves with them. Seems like v2 will be the way to go for deno.

We can't use import because v2 will be able to run natively in browsers. Which can't import node:crypto.

@paulmillr
Copy link
Owner

tl;dr: v2 will use webcrypto, which is present in deno

@alexgleason
Copy link
Author

Cool, I think that's a good solution. Thanks for taking a look!

@paulmillr
Copy link
Owner

Also did you know deno now natively supports npm modules? Google: npm specifier deno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants