PHP WebShell
Текущая директория: /opt/BitGoJS/modules/sdk-coin-dot/node_modules/@polkadot/x-randomvalues
Просмотр файла: react-native.js
import { NativeModules } from 'react-native';
import { base64Decode } from '@polkadot/wasm-util/base64';
import { xglobal } from '@polkadot/x-global';
import { crypto as cryptoBrowser, getRandomValues as getRandomValuesBrowser } from './browser.js';
import { insecureRandomValues } from './fallback.js';
export { packageInfo } from './packageInfo.js';
/**
* @internal
*
* A getRandomValues util that detects and uses the available RN
* random utiliy generation functions.
**/
function getRandomValuesRn(output) {
return base64Decode(NativeModules.RNGetRandomValues
? NativeModules.RNGetRandomValues.getRandomBase64(output.length)
: NativeModules.ExpoRandom.getRandomBase64String(output.length), output);
}
export const getRandomValues = ((typeof xglobal.crypto === 'object' && typeof xglobal.crypto.getRandomValues === 'function')
? getRandomValuesBrowser
: (typeof xglobal['nativeCallSyncHook'] === 'undefined' || !NativeModules['ExpoRandom'])
? insecureRandomValues
: getRandomValuesRn);
export const crypto = (getRandomValues === getRandomValuesBrowser
? cryptoBrowser
: { getRandomValues });
Выполнить команду
Для локальной разработки. Не используйте в интернете!