-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we have a synchronous version? #5
Comments
Second that. Also, SHA3 variants like from https://github.com/Caligatio/jsSHA? |
+1 for synchronous version |
It is not possible to create a synchronous version! In React Native, everything that has to cross the bridge between Javascript and a native module is asynchronous! Either callbacks or promises. If you want a synchronous version use a pure Javascript SHA-256 package. Note that browser crypto (in crypto.subtle.digest) also returns a promise! Doing crypto is CPU intensive, and anything in Javascript that is CPU bound is better off being done in a separate thread (worker, if it's Javascript). It is bad design to build a Javascript application on modern multithreaded n-CPU hardware that starts a CPU intensive task in the main Javascript thread! So you should embrace the asynchronous API for anything crypto. |
Agreed. But adding other sha3 variants which was the main issue with this issue (hah) would be nice. |
If you don't want to wait, and I made the experience that if you see a package is only "loosely maintained" that it is best not to expect much (there's someone just like you on the other side,, with stuff to do other than implementing stuff for others), you can check out and the respective ios file to see how easy it is to add a few lines. Just fork the repo, implement it, then send a pull request :-) I just to hate this advice when I was on the receiving end, but I think it's one thing when you get it from a busy big repo with many maintainers and one where doing a fork is hard because they keep develping it faster than you can maintain your fork, compared to packages like the one right here, where you are probably better off maintaining your own fork unless the original version is enough. |
Handy to use inside a redux reducer..
And may be SHA-512 as well as HMAC-SHA-256/512 as well that are often needed?
The text was updated successfully, but these errors were encountered: