This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
WebCrypto.getRandomValues vs crypto.randomBytes #46
Labels
Comments
are you trying to collect all strange behavior of webcrypto here? ;) |
@dignifiedquire exactly, hopefully it will be useful to enumerate issues in the future |
As a side note, the webcrypto api is much more sensible when trying to optimize for speed and allocations. You can manage your own array and fill it with random values, whereas the node api is actually much worse, as it forces allocation of a new buffer when generating random values. |
Still a |
ghost
assigned hugomrdias
Dec 5, 2018
ghost
added
status/in-progress
In progress
and removed
status/deferred
Conscious decision to pause or backlog
labels
Dec 5, 2018
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
crypto.randomBytes
https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback
returns a Buffer with random bytes given the size
WebCrypto.getRandomValues(arr)
https://developer.mozilla.org/en/docs/Web/API/RandomSource/getRandomValues
overwrites an array with randomBytes
Why didn't WebCrypto do the same thing that Node.js was doing, when it came after?
The text was updated successfully, but these errors were encountered: