PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/react-native-securerandom
Просмотр файла: index.js
/* @flow */
import { NativeModules, Platform } from 'react-native';
import { toByteArray } from 'base64-js';
const { RNSecureRandom } = NativeModules;
export function generateSecureRandom(length: number): Promise<Uint8Array> {
if (Platform.OS !== 'ios' && Platform.OS !== 'android') {
throw Error('react-native-securerandom is currently only available for iOS and Android');
}
if (!RNSecureRandom || !RNSecureRandom.generateSecureRandomAsBase64) {
throw Error('react-native-securerandom is not properly linked');
}
return RNSecureRandom.generateSecureRandomAsBase64(length).then(base64 => toByteArray(base64));
}
Выполнить команду
Для локальной разработки. Не используйте в интернете!