browserify / randombytes

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

Remove buffer? #25

Closed jimmywarting closed 1 year ago

jimmywarting commented 3 years ago

Could you make this less dependent on node stuff?

Would like to see a major update where Uint8Array is returned instead on both node and browser. Buffer is unnecessary in many cases where it's just seen as a Uint8Array. And where many node core feature is more acceptable of typed arrays instead So including Buffer (safe-buffer) in the browser is just bloated and unnecessary.

Think if ppl need a Buffer then they should use Buffer.from(randombytes(1)) instead.


Can make a PR if you wish

dcousens commented 1 year ago

safe-buffer has been removed in https://github.com/browserify/randombytes/pull/27

dcousens commented 1 year ago

@jimmywarting I understand your reasoning, but I don't think we want to broaden the scope of this package when it should always produce the same output and types as node.

Unfortunately this package is called randombytes, and not @browserify/randombytes, but, it's likely package scopes weren't available when the project started.