Git Product home page Git Product logo

Comments (7)

jprichardson avatar jprichardson commented on June 29, 2024

OK, after discovering a bug in the createHmac in [email protected] (latest in Browserify) v3, I figured this out. Not sure if the bug exists in the 2.x version, but I'll find out shortly.

This should work for anyone who is in the same position.

  1. Clone crypto-browserify
  2. Install NPM deps
  3. Build it: browserify < index.js > crypto-browserify.js
  4. In your app's package.json file, add the following field:
"browser": {
  "crypto": "./crypto-browserify.js"    
} 

(Obviously copy crypto-browserify.js to your app's repo and change the path accordingly)

from crypto-browserify.

jprichardson avatar jprichardson commented on June 29, 2024

Actually, that doesn't work. I get the following error:

Error: module "./support/isBuffer" not found from "/Users/jp/js/cryptocoin/pbkdf2-sha256/crypto-browserify.js"

Any thoughts?

from crypto-browserify.

jprichardson avatar jprichardson commented on June 29, 2024

When opening crypto-browserify.js it's clear that Buffer is in there.

from crypto-browserify.

tonistiigi avatar tonistiigi commented on June 29, 2024

Don't create a separate bundle for crypto-browserify. Just do npm install crypto-browserify and add "browser": {"crypto": "crypto-browserify"} to package.json.

from crypto-browserify.

jprichardson avatar jprichardson commented on June 29, 2024

@tonistiigi but what if I actually want to modify crypto-browserify?

from crypto-browserify.

tonistiigi avatar tonistiigi commented on June 29, 2024

Installing from npm doesn't forbid you of changing the source in any way. If you want to change and share back the changes with git then there are lots of ways. I usually make a clone somewhere, then run npm link from the clone and npm link crypto-browserify from the project code folder.

from crypto-browserify.

jprichardson avatar jprichardson commented on June 29, 2024

I think this can be closed now :p

from crypto-browserify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.