Closed sinewave440hz closed 6 years ago
I see. Are you looking for a repo you can clone? Are you using Expo or have you ejected?
An example in its own right would be great, but just something to prove that everything is up and running correctly would be fine - a little more than the function in the readme, basically, to cover usage. (I am having problems, and yes in effect I have ejected, in that I started with a react-native inited project).
(I do have specific issues that I will open separately btw)
Wow, that ensureSecure
example is wrong. I'd forgot to change the example when I moved from callbacks to promises. I'll update it, but here's how to use it in the meantime:
crypto.ensureSecure()
.then(() => {
const array = new Uint8Array(1);
crypto.getRandomValues(array);
this.setState({
random: array[0]
});
})
.catch(err => {
console.log('unable to ensure security', err)
});
edit: The example in the README isn't wrong, it just uses async
/await
https://github.com/kevlened/webcrypto-react-native-examples/tree/master/crna-ejected
I'll add this to the README in a bit
Included links to the examples in the README
This would be much appreciated. Just something to demonstrate the ensureSecure process.