UNPKG

482 BJavaScriptView Raw
1export default {
2 get name() {
3 return 'ExpoRandom';
4 },
5 getRandomBytes(length) {
6 const array = new Uint8Array(length);
7 // @ts-ignore
8 return (window.crypto ?? window.msCrypto).getRandomValues(array);
9 },
10 async getRandomBytesAsync(length) {
11 const array = new Uint8Array(length);
12 // @ts-ignore
13 return (window.crypto ?? window.msCrypto).getRandomValues(array);
14 },
15};
16//# sourceMappingURL=ExpoRandom.web.js.map
\No newline at end of file