browserify / sha.js

Streamable SHA hashes in pure javascript
Other
288 stars 60 forks source link

Project is not "pure JavaScript" as advertised. #63

Closed wjhurley closed 4 years ago

wjhurley commented 4 years ago

According to npm, your project has safe-buffer as a dependency, which is for use with nodejs. Your project will not run in an environment without nodejs, so you should probably update the description so that users are aware of this.

fanatid commented 4 years ago

Why you think that safe-buffer usage makes project not pure JavaScript?

wjhurley commented 4 years ago

Just as I stated above, safe-buffer is for use with nodejs. If you look at the code, it relies on nodejs packages not available client-side. I also tried using this project in a React Native app and it would not work because of the missing nodejs package(s).

fanatid commented 4 years ago

safe-buffer does not make sha.js not pure JavaScript. This package used for browserifing crypto module from Node.js, so it's not possible ignore Buffer type. Even if we did not used safe-buffer, Buffer still used here (actually safe-buffer not required anymore, because not safe constructors not available now). Pure JavaScript here means that there no any bindings and no compilation steps. You faced with problem not because this project pure or not pure JavaScript, it's because React Native apps hardly work with Buffer. (I did not worked with React Native apps & Buffer, but had seen a lot of similar issues).

Not sure what advice should be here... try fix Buffer for React Native apps or find/create other SHA hasher without Buffer.