Can I use web crypto api in NextJS?
I tried to use
crypto.subtle.digest('SHA-256', data)
but getting an error
ReferenceError: crypto is not defined
Before using the crypto module, just import it with import crypto from "crypto"
Here are examples for crypto
For me, it worked when I used import * as
import * as crypto from 'crypto';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With