Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Nodejs crypto not working #540

Closed
Bigmacbook opened this Issue · 4 comments

4 participants

Ryan Ma Donghao Mithgol Roger Wang
Ryan

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!

Ma Donghao

It seems there is no problem in my computer.

my file tree:

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

it's ok.

Ryan

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');
Ryan Bigmacbook closed this
Mithgol

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

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

Roger Wang
Owner

@Mithgol thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.