dropbox / dropbox-api-content-hasher

Code to compute the Dropbox API's "content_hash"
Other
69 stars 30 forks source link

JS Browser support #11

Open kamranayub opened 5 years ago

kamranayub commented 5 years ago

Just wanted to let you know the content hasher works nicely in the browser with a small change to the packages being used:

- const crypto = require('crypto')
+ import { Buffer } from 'buffer/'
+ import crypto from 'crypto-browserify'

Packages:

npm install buffer
npm install crypto-browserify

That's all I had to change for my Webpack-based app.

greg-db commented 5 years ago

Thank you for sharing this! I'll ask the team to add this.

kamranayub commented 5 years ago

Yup works nicely for my web app!

On Mon, Mar 11, 2019, 3:02 PM Greg K notifications@github.com wrote:

Thank you for sharing this! I'll ask the team to add this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dropbox/dropbox-api-content-hasher/issues/11#issuecomment-471701346, or mute the thread https://github.com/notifications/unsubscribe-auth/AAiaayiUyqBNMnb0axy9TyaCIw8eCe6Hks5vVrZugaJpZM4bm4dD .