srijs / rusha

High-performance pure-javascript SHA1 implementation suitable for large binary data, reaching up to half the native speed.
https://npmjs.org/rusha
MIT License
275 stars 32 forks source link

Support SHA-2 (SHA-256) #7

Open fjakobs opened 11 years ago

fjakobs commented 11 years ago

Are you planning to add more hashing algorithms? I'm using rusha to compute HMAC codes and the backend might require HMAC-SHA-256 instead of HMAC-SHA-1. I really don't wanna use a different (slower) library for that.

srijs commented 11 years ago

Hi there. Sorry for the late reply.

I'd really like to add more algorithms to Rusha, but unfortunately lack the temporal resources for that. Tim Caswell claims his Cifre library (including SHA256) (https://github.com/openpeer/cifre) is also pretty fast. So you are probably better off using that for SHA256.

However, a less performant "base" version should be trivial to implement, as the mechanisms for converting input can be reused and only the RushaCore module would have to be swapped. If someone would do that, I'd do my very best to optimize it to Rusha-typical performance ;)