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

Error when try to use Diffie-Hellman properties #194

Open
Raktim123 opened this issue Aug 20, 2020 · 4 comments
Open

Error when try to use Diffie-Hellman properties #194

Raktim123 opened this issue Aug 20, 2020 · 4 comments

Comments

@Raktim123
Copy link

Raktim123 commented Aug 20, 2020

I want to use this library in my project to archive NodeJS crypto on browser.

I already downloaded the above package. In the given example it shows createHash. I want to use .createDiffieHellman etc. But, it rises error. Here is my code.

<!doctype html>
<html>
<script src='bundle.js'></script>
<body>
<h1>Welcome</h1>
</body>
<script>
      console.log(require('crypto').createDiffieHellman(139));
</script>
</html>

and I facing error says, Uncaught TypeError: require(...).createDiffieHellman is not a function in the browser console.

Even I tried to change the code on my computer project/node_modules/crypto-browserify/example/index.html and also tried to copy the repository from github, but result is same.

I can't understand what happen?

@calvinmetcalf
Copy link
Contributor

how did you bundle it ?

@Raktim123
Copy link
Author

First off all I copied the bundle.js file on my project root folder and then just add <script src="bundle.js"></script> on my HTML file.

@Raktim123
Copy link
Author

I observe two things that there are maybe one spelling mistake in bundle.js (line 406) It's actually createDiffieHellman not createDeffieHellman and another is that only only createHash was exported from bundle.js if I call other it says message like 'it is not implemented yet'.

@rawr51919
Copy link

#200 should hopefully fix this issue by trimming down the error messages to only those unimplemented as per the readme.

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

Successfully merging a pull request may close this issue.

3 participants