Nodejs crypto not working #540

Closed
Bigmacbook opened this Issue Mar 13, 2013 · 4 comments

Projects

None yet

4 participants

@Bigmacbook

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!

Contributor

It seems there is no problem in my computer.

my file tree:

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

it's ok.

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');
@Bigmacbook Bigmacbook closed this Mar 13, 2013
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.

Member

@Mithgol thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment