serialize-javascript icon indicating copy to clipboard operation
serialize-javascript copied to clipboard

Support for buffers

Open smulikHakipod opened this issue 5 years ago • 2 comments

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

smulikHakipod avatar Aug 27 '19 16:08 smulikHakipod

Buffer is implemented only for Node.js. I think supporting TypedArray is better.

okuryu avatar Oct 01 '19 12:10 okuryu

Buffer is implemented only for Node.js. I think supporting TypedArray is better.

Agree! disapprove of this PR

Speaking of... the package randombytes uses safe-buffer which brings in Buffer into the browser anyway? Could you use a version that don't depend on it? Simply use Uint8Array + crypto.getRandomValues instead?

...or if it isn't super critical to be hyper uniq maybe Math.random is sufficient?

jimmywarting avatar Jun 13 '21 00:06 jimmywarting