browserify / crypto-browserify

partial implementation of node's `crypto` for the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crypto.constants = undefined

futurelucas4502 opened this issue · comments

When using crypto-browserify or just browserify to require crypto i want to use the following:

const encryptedData = crypto.publicEncrypt({
        key: `some public key`,
        padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
        oaepHash: "sha256",
    },
        Buffer.from(password) // We convert the data string to a buffer using `Buffer.from` so we can manipulate the data using publicEncrypt
    )

But crypto.constants = undefined so I'm not sure what to do?

This issue has also been mentioned on browserify here and was requested to be moved to this repo as well.