browserify / randombytes

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

Fails for me as Uncaught ReferenceError: global is not defined #5

Closed frozeman closed 7 years ago

frozeman commented 7 years ago

You check for the crypto object one global not on window and therefore fails for me when used as a dependency in another project. Why using global?

frozeman commented 7 years ago

And if this is something specific to browserify, how i make this package work in vanilla js?

calvinmetcalf commented 7 years ago

var global = window;

frozeman commented 7 years ago

Yeah this will break a lot of other dependencies which use the presence of global to determine wether they are in a node or browser in env.

Are there not better options?

calvinmetcalf commented 7 years ago

you could use it with browserify like it's intended, or you could just modify the version you are using to work in the specific environment you are using it in

frozeman commented 7 years ago

Yeah i build my own: https://github.com/frozeman/randomHex

calvinmetcalf commented 7 years ago

there is no actual code in that repo fyi

On Thu, Mar 23, 2017 at 3:45 PM Fabian Vogelsteller < notifications@github.com> wrote:

Yeah i build my own: https://github.com/frozeman/randomHex

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/crypto-browserify/randombytes/issues/5#issuecomment-288838635, or mute the thread https://github.com/notifications/unsubscribe-auth/ABE4n8tbkh5xEIVZ-NDkZGKcQeAirnvvks5rosvWgaJpZM4MnCLN .

frozeman commented 7 years ago

? Maybe i dint pushed by then, but there is now :P

jvlad commented 1 year ago

@frozeman thanks, maybe. But now there isn't:) It looks like some relevant files were removed from the repo work dir in this commit: https://github.com/frozeman/randomHex/commit/cd6a244b84e42a0d166a746ac5ba542065b16e87#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346