browserify / randombytes

random bytes from browserify stand alone
MIT License
99 stars 47 forks source link

Use globalThis in place of global #31

Closed Frando closed 2 years ago

Frando commented 2 years ago

I ran into issues with a JavaScript bundler (vite) and the resulting package not working in the browser due to global being undefined. globalThis is the now widely supported standard way to access the global object. This PR changes the browser impl to use globalThis instead of global.

Frando commented 2 years ago

I see that this was closed before in #24 If people are looking for a workaround for bundlers that don't inject global, I republished the module with this change as @frando/randombytes for my own use.