mirror of
https://github.com/status-im/react-native-randombytes.git
synced 2026-08-27 17:11:12 +00:00
update README.md
This commit is contained in:
@@ -6,6 +6,13 @@ Note: only the asynchronous API is supported, due to the limitations of having t
|
||||
|
||||
```js
|
||||
var randomBytes = require('react-native-randombytes')
|
||||
|
||||
// synchronous API
|
||||
// uses SJCL
|
||||
var rand = randomBytes(4)
|
||||
|
||||
// asynchronous API
|
||||
// uses iOS-side SecRandomCopyBytes
|
||||
randomBytes(4, (err, bytes) => {
|
||||
console.log(bytes.toString('hex'))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user