ghbutton / react-native-simple-crypto

A simpler React-Native crypto library
https://www.npmjs.com/package/react-native-simple-crypto
MIT License
42 stars 25 forks source link

Why promises for hashing functions? #42

Open pke opened 2 years ago

pke commented 2 years ago

I wonder why the hashing functions are all sync natively, yet return promises? Any reason for that?

ghbutton commented 2 years ago

That is a good question, I can work on that

pke commented 2 years ago

Its seems using sync function have some implications https://reactnative.dev/docs/native-modules-ios#synchronous-methods

ghbutton commented 2 years ago

I still think making them async is the way to go

ghbutton commented 2 years ago

Fixed here: https://github.com/ghbutton/react-native-simple-crypto/pull/44

ghbutton commented 2 years ago

I invited you as a collaborator if that is ok