Closed eins78 closed 9 years ago
That's a fair point- in practice, I don't think I'm even using the sha1-based convenience functions any more (IIRC all my implementations are either calling a vendored sha1 function and passing its results to the module's main functions, or calling arbitrary hash functions via crypto
externally like images.hashblot.com).
I might make some kind of derived drop-in replacement of this module that extends it with the sha1 methods (and maybe incorporates any_sha1
, for the non-browserify use cases), then reduce this to just the abstract path-from-hash functions.
Actually, I think I'll just cut that functionality altogether for 0.5 and include the two lines that define them as a note on backward-compatibility in the README.
Btw: your code works fine as-is when ignoring the crypto
module in the browserify
config section of the package.json
.
For me, this issue is solved. Here is the solution:
To use the library with browserify, require('any-sha')
from npm and set up as in the examples.
Then ignore the crypto
module by putting this in the package.json
:
{
"browserify": {
"ignore": [
"crypto"
]
}
}
Since browserify only does static requires, the whole
crypto
module always ends up in the bundle (actuallycrypto-browserify
since it's shimmed).It would be really nice to be able to require just the actual hashblot lib.