browserify / randombytes

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

fix(IE): getRandomBytes fails when size=0 on IE. #4

Closed sha49 closed 8 years ago

sha49 commented 8 years ago

Fun IE stuff.

On IE11 if you run: msCrypto.getRandomValues(new Uint8Array(0)) , it launches an exception: InvalidStateError

If you do the same on chrome it returns an empty list as it should be.

So, I think not calling getRandomValues when the size is zero solves the problem.

jprichardson commented 8 years ago

Please put a whitespace after the if (in accordance with standard - you can run npm test to verify).

dcousens commented 8 years ago

LGTM

dcousens commented 8 years ago

ping @calvinmetcalf for review + release

calvinmetcalf commented 8 years ago

looks general good, I can review, browser test, and release latter this weekend/monday

sha49 commented 8 years ago

are you planning to do a release with that fix? Thanks!

calvinmetcalf commented 8 years ago

I pushed up a test and if that looks good I'll publish it

calvinmetcalf commented 8 years ago

and it does publishing as 2.0.3