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

Nodejs crypto not working #540

Closed
ghost opened this issue Mar 13, 2013 · 4 comments
Closed

Nodejs crypto not working #540

ghost opened this issue Mar 13, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2013

I start off with this

var crypto = require('crypto');

var md5 = crypto.createHash('md5');

and I get this Uncaught TypeError: Object #Crypto has no method 'createHash'

I have no idea what is going on. This should work!

@owenc4a4
Copy link
Contributor

It seems there is no problem in my computer.

my file tree:

app/
|-- ...
|-- node_modules/
    |-- crypto/

it's ok.

@ghost
Copy link
Author

ghost commented Mar 13, 2013

Solved my problem. webkit was already using the var crypto so i had to rename it to crypt

Working example:

var crypt = require('crypto');

var md5 = crypt.createHash('md5');

@Mithgol
Copy link
Contributor

Mithgol commented May 14, 2013

After #713 it seems to become a kind of frequently asked question.

I've just added a note in wiki for future references.

@rogerwang
Copy link
Member

@Mithgol thanks

This issue was closed.
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

No branches or pull requests

3 participants