Fix web build

This commit is contained in:
Paul Frazee 2022-06-15 22:33:16 -05:00
parent 172ed1e2cd
commit de87ec17d1
9 changed files with 88 additions and 56 deletions

View file

@ -1,12 +1,11 @@
// import {generateSecureRandom} from 'react-native-securerandom'
import {NativeModules} from 'react-native'
const {AppSecureRandomModule} = NativeModules
import {toByteArray} from 'base64-js'
// @ts-ignore we dont have types for this -prf
import crypto from 'msrcrypto'
import '@zxing/text-encoding' // TextEncoder / TextDecoder
async function generateSecureRandom(bytes: number) {
console.log('a')
return toByteArray(
await AppSecureRandomModule.generateSecureRandomAsBase64(bytes),
)